You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2006-02-20.22:10:05.000>created_at=<Date2005-08-19.02:07:29.000>labels= ['interpreter-core']
title='type() and isinstance() do not call __getattribute__'updated_at=<Date2006-02-20.22:10:05.000>user='https://bugs.python.org/pervognsen'
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__).
I don't think this is going to change. A number of builtins
directly access an object's structure and do not respect
overrides via __getattribute__. This is somewhat intrinsic
the Python's current design.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: