> > > If I understand your question, classes are not singletons: > > >>>> ll=[] > > >>>> for i in range(2): > > > import string > > > ll[i]=string > > > Where's the IndexError? :-) > > > I accept my question about classes being singletons is not well-formed, > > not even in my own mind. I guess one way of asking is, for any two class > > objects (not instances) C1 and C2, does "C1 == C2" imply "C1 is C2"?
Similarly, no. >>> class metaC( type ): ... def __eq__( self, other ): ... return True ... >>> class C( metaclass= metaC ): ... pass ... >>> class D( metaclass= metaC ): ... pass ... >>> C==D True >>> C is D False +1 raised eyebrow -- http://mail.python.org/mailman/listinfo/python-list