<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>ChainMap on Nalar</title>
    <link>https://nalar.dev/tags/chainmap/</link>
    <description>Recent content in ChainMap on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 03 Sep 2026 00:00:00 +0700</lastBuildDate>
    <atom:link href="https://nalar.dev/tags/chainmap/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Layer Configuration Safely with Python ChainMap</title>
      <link>https://nalar.dev/layer-configuration-safely-with-python-chainmap/</link>
      <pubDate>Thu, 03 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/layer-configuration-safely-with-python-chainmap/</guid>
      <description>&lt;p&gt;Applications often build configuration from several sources. Command-line arguments may override environment-derived values, which in turn override built-in defaults. A straightforward implementation copies dictionaries and applies &lt;code&gt;update()&lt;/code&gt; repeatedly.&lt;/p&gt;&#xA;&lt;p&gt;That works, but copying hides an important part of the design: configuration is not merely one dictionary. It is a &lt;strong&gt;precedence chain&lt;/strong&gt; of independent sources.&lt;/p&gt;&#xA;&lt;p&gt;Python&amp;rsquo;s &lt;code&gt;collections.ChainMap&lt;/code&gt; makes that relationship explicit. It presents several mappings as one lookup view without merging them first.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
