Very minor point: be careful comparing IDs the way you do in the REPL (i.e., without keeping a reference to the previous object)--since the old one is released, it&#x27;s possible that the memory address is reused and the ID of the new object ends up being the same, even though the object is different, which can have misleading results:<p><pre><code>    Python 2.7.10 (default, Oct 23 2015, 19:19:21) 
    [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
    Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
    &gt;&gt;&gt; class A:
    ...   def b(self): pass
    ... 
    &gt;&gt;&gt; A.b
    &lt;unbound method A.b&gt;
    &gt;&gt;&gt; hex(id(A.b))
    &#x27;0x104e2c0a0&#x27;
    &gt;&gt;&gt; hex(id(A.b))
    &#x27;0x104daeb90&#x27;
    &gt;&gt;&gt; hex(id(A.b))
    &#x27;0x104daeb90&#x27;
</code></pre>
So the `x is y` approach is &quot;safer.&quot; :)