[Python-Dev] repr(x) != x.__repr__()
Oren Tirosh
oren-py-d@hishome.net
Thu, 28 Mar 2002 11:09:39 -0500
On Thu, Mar 28, 2002 at 10:28:12AM -0500, Guido van Rossum wrote:
> I'm probably going to reject this bug as "won't fix". I specifically
> put code in the new classes to create this behavior. It's partly a
> performance hack: many operations become much slower if they have to
> check the instance __dict__ first. But I also believe it's poor
If this is by design it's ok. I suspected it might be an accidental result
of the different internal structure of new style classes.
> check the instance __dict__ first. But I also believe it's poor
> style to override a system operation on the instance rather than on
> the class.
And if it's not a system operation? Is method assignment in general
considered poor style? Something as vile and unspeakable as changing an
object's __class__ at runtime? ;-)
Oren