<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Dispatch on Nalar</title>
    <link>https://nalar.dev/tags/dispatch/</link>
    <description>Recent content in Dispatch on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 02 Sep 2026 00:00:00 +0700</lastBuildDate>
    <atom:link href="https://nalar.dev/tags/dispatch/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Single Dispatch in Python: Extensible Type-Based Behavior</title>
      <link>https://nalar.dev/single-dispatch-in-python-extensible-type-based-behavior/</link>
      <pubDate>Wed, 02 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/single-dispatch-in-python-extensible-type-based-behavior/</guid>
      <description>&lt;p&gt;A function that accepts several kinds of input often begins with a few &lt;code&gt;isinstance()&lt;/code&gt; checks. That approach is straightforward when the cases are small and local. As the number of supported types grows, however, one function can become a long decision tree that mixes unrelated implementations.&lt;/p&gt;&#xA;&lt;p&gt;Python&amp;rsquo;s &lt;code&gt;functools.singledispatch&lt;/code&gt; offers another design. It turns one function into a generic function whose implementation is selected from the runtime type of its first argument. Type-specific behavior can then be registered separately while callers keep using one public function.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
