Classes and modules are singletons?
gagsl-py2 at yahoo.com.ar
Fri Mar 7 00:17:49 CET 2008
En Thu, 06 Mar 2008 20:45:09 -0200, <castironpi at gmail.com> escribi�:
> I'd like to question the source of the definition of C.__eq__.
>>>> class C: pass
>>>> class D: pass
>>>> C== D
> What is different about them? I've created two empty classes, nothing
Their __name__ attribute?
Types are compared by their memory addresses, not by contents, and that's
enough and efficient for most people. If you require something different,
use a metaclass.
More information about the Python-list