This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pervognsen
Recipients
Date 2005-08-19.02:07:29
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
The built-in functions type() and isinstance() do not call 
__getattribute__ for instances of user-defined classes. 
Thus, for instance,

x.__class__ == sometype

and

type(x) == sometype

can give inconsistent results.

I ran into this problem in writing a transparent 
persistence system, where instances of proxy classes 
are used as stand-ins for unloaded objects and the 
proxy does just-in-time loading by overloading 
__getattribute__ and __setattr__ (which changes 
__class__).

(This applies to 2.4.1.)
History
Date User Action Args
2007-08-23 14:33:53adminlinkissue1263635 messages
2007-08-23 14:33:53admincreate