clash of the methods (was Re: Why no number methods?)

James_Althoff at James_Althoff at
Wed May 16 00:50:37 CEST 2001

Michael writes:
>Well, assume that we have magically healed the type/class split so
>that all objects behave like instances.  Then imagine:
>class C:
>    def __repr__(self):
>        return "bongle"
>What's C.__repr__?  Quick!

A big problem since we want a __repr__ method for instances of C *and* a
__repr__ method for the class object C -- and these can be confused (or
collide) in C.__dict__.


More information about the Python-list mailing list