Is types.InstanceType no longer valid with Python 2.2

Emile van Sebille emile at fenx.com
Thu Jan 3 13:51:51 EST 2002


"Georg Lohrer" <GeorgLohrer at gmx.de> wrote in message
news:43293uk34r6dgn5vgel7j0uiekhg6jp0no at 4ax.com...
[snipped]
> Therefore I need recognizing an instantion of a class. If I could be
> assured that only a class-instantiation could have a __dict__ then a
> possible solution would be try..catch AttributeError to catch all
> other items. But with Python 2.1 the InstanceType decision was more
> elegant.
>
> Ciao, Georg
>

Aside from Skip verifying that InstanceType works in 2.2 (which I hadn't,
but have since) and so it should for you, one attribute that may do it is
__class__.  I'm not aware that this is used otherwise.

HTH,


--

Emile van Sebille
emile at fenx.com

---------




More information about the Python-list mailing list