Lambdas and Functions in Python
It&#x27;s interesting to note that a dictionary (&quot;catalog&quot;) of values is essentially the same concept as an object. This is clearer in Javascript, where `{...}` notation is called an &quot;object&quot; rather than a &quot;dictionary&quot; and the `.foo` and `[&quot;foo&quot;]` notations are mostly interchangable.<p>Storing functions in a dictionary is <i>very</i> close to storing methods in an object. The only differences are sharing state via a `self` (or `this`) argument, and inheritance chains (either from classes or prototypes).<p>Also interesting to note that many of the author&#x27;s functions, like `lambda x, y: x + y`, only make sense because the underlying language (Python) thought that constructs like `+` shouldn&#x27;t be functions for some reason. Many languages seem to do this, e.g. here&#x27;s a bug report I raised for PHP <a href="https:&#x2F;&#x2F;bugs.php.net&#x2F;bug.php?id=66368" rel="nofollow">https:&#x2F;&#x2F;bugs.php.net&#x2F;bug.php?id=66368</a><p>When we introduce arbitrary distinctions, like dictionary vs object, named vs anonymous functions, functions vs operators, etc. then we end up with all of the choices and complications like those shown in this article.<p>One of the principles I try to follow when programming is to <i>avoid</i> making distinctions, or breaking symmetries, unless my hand is forced by the underlying dynamics. Experience has taught me that introducing distinctions in one place just introduces complication elsewhere (e.g. more cases to handle when metaprogramming).