<story><title>Python wats</title><url>https://github.com/cosmologicon/pywat</url></story><parent_chain><item><author>ak217</author><text>Of these, only += on tuple elements and indexing with floats strike me as WTFs, and many others are evidence of the author really going out of their way to look for behaviors to nitpick on. The absolute majority of these are things that Python programmers either will never encounter, or can easily explain from Python &amp;quot;first principles&amp;quot; (e.g. most of the nitpicks on string and sequence behaviors).&lt;p&gt;I can tell you what I consider WTF worthy - things that I and others have undoubtedly been bitten by because they are ubiquitous. Those are mutable defaults, lack of loop scoping, and &amp;quot;global&amp;quot;&amp;#x2F;&amp;quot;nonlocal&amp;quot; scoping. Oh, and add the crazy &amp;quot;ascii&amp;quot; I&amp;#x2F;O encoding default on 2.7 (and the inability to cleanly reset it) to that list.</text></item></parent_chain><comment><author>crdoconnor</author><text>Truthiness values are also WTF worthy (although not mentioned above).&lt;p&gt;&lt;pre&gt;&lt;code&gt;    if not x:
        do_something()
&lt;/code&gt;&lt;/pre&gt;
Where do_something will occur if x is None, zero, 0.0, a blank string or even &lt;i&gt;midnight&lt;/i&gt; in some versions of python.&lt;p&gt;This has bitten me multiple times. It&amp;#x27;s a violation of python&amp;#x27;s explicit over implicit. It&amp;#x27;s an example of weak typing in an otherwise strongly typed language. There&amp;#x27;s really no good reason for it.&lt;p&gt;IMO, if x isn&amp;#x27;t a boolean, that line should just throw an exception. If you want to check for x being 0.0 or &amp;quot;&amp;quot;, you should do x == &amp;quot;&amp;quot; or x == 0.0.</text></comment>
<story><title>Python wats</title><url>https://github.com/cosmologicon/pywat</url></story><parent_chain><item><author>ak217</author><text>Of these, only += on tuple elements and indexing with floats strike me as WTFs, and many others are evidence of the author really going out of their way to look for behaviors to nitpick on. The absolute majority of these are things that Python programmers either will never encounter, or can easily explain from Python &amp;quot;first principles&amp;quot; (e.g. most of the nitpicks on string and sequence behaviors).&lt;p&gt;I can tell you what I consider WTF worthy - things that I and others have undoubtedly been bitten by because they are ubiquitous. Those are mutable defaults, lack of loop scoping, and &amp;quot;global&amp;quot;&amp;#x2F;&amp;quot;nonlocal&amp;quot; scoping. Oh, and add the crazy &amp;quot;ascii&amp;quot; I&amp;#x2F;O encoding default on 2.7 (and the inability to cleanly reset it) to that list.</text></item></parent_chain><comment><author>hueving</author><text>The indexing with a float was on a dict. If you can index with a string, why not a float? If it&amp;#x27;s hashable, it&amp;#x27;s good!</text></comment>