isinstance() bug

Rainer Deyke rainerd at eldwood.com
Wed Jan 28 20:50:17 CET 2004


Michal Vitecek wrote:
>  it's my belief that if i'm instantiating a class from the same
>  location no matter how i imported its definition, its instances are
>  always of the same class.

Your belief is incorrect.  'package.module.A' and 'module.A' are distinct
classes.  Modifications to one do not show up in the other.  If 'isinstance'
reported that an instance of 'package.module.A' is an instance of
'module.A', 'isinstance' would be broken and unusable.


-- 
Rainer Deyke - rainerd at eldwood.com - http://eldwood.com





More information about the Python-list mailing list