isinstance() bug

Michal Vitecek fuf at mageo.cz
Thu Jan 29 09:37:46 CET 2004


Rainer Deyke wrote:
>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.

 could you elaborate further why do you consider the current behaviour
 to be correct? you've only described how it works currently. i'd be
 interested what's the reasoning behind that.
 
 i'm inclined to think that the current behaviour is a side-effect of
 the implementation (perhaps to which some got used to?).

-- 
		fuf		(fuf at mageo.cz)




More information about the Python-list mailing list