Is types.InstanceType no longer valid with Python 2.2

Alex Martelli aleax at aleax.it
Fri Jan 4 22:39:51 CET 2002


Georg Lohrer wrote:
        ...
> Okay, one way would be to compare the type of the object with all
> other types in 'types' (except InstanceType). If all fail, the object
> must be an instance of a class. Not very satisfying, is it.

Particularly not *correct* -- it would identify, e.g., the result of an 
array.array call as "an instance of a class", which it most surely ISN'T.


Alex




More information about the Python-list mailing list