A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-March/021860.html below:

[Python-Dev] repr(x) != x.__repr__()

[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




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4