<p>Why we can&#39;t have nice things, Python Turtle Logo edition</p><p>Their REPR are precisely equal. But their internals still differ enough for the &quot;IS&quot; Comparison Operator to call them Too Different 😝</p><p> % python3 -i -c &#39;&#39;<br /> &gt;&gt;&gt; <br /> &gt;&gt;&gt; import turtle<br /> &gt;&gt;&gt; t = turtle.Turtle()<br /> &gt;&gt;&gt; <br /> &gt;&gt;&gt; t.screen.clear<br /> &lt;bound method TurtleScreen.clear of &lt;turtle._Screen object at 0x1035ddd30&gt;&gt;<br /> &gt;&gt;&gt; t.screen.clearscreen<br /> &lt;bound method TurtleScreen.clear of &lt;turtle._Screen object at 0x1035ddd30&gt;&gt;<br /> &gt;&gt;&gt; t.screen.clear is t.screen.clearscreen<br /> False<br /> &gt;&gt;&gt; </p><p>False</p><p>Ugh</p><p><a href="https://social.vivaldi.net/tags/PythonIsEaSy" class="mention hashtag" rel="tag">#<span>PythonIsEaSy</span></a> # PyThOn Is EaSy</p>
Reply