[Tutor] isinstance -> instance
3dbernard at gmail.com
Mon Feb 26 22:33:46 CET 2007
Following the guidelines here, at the bottom of the page:
I'm using isinstance() to test the type of some data.
Now the thing is that, what is the name to use for a class instance?
For example, say I run this:
def __init__( self ):
self.a = 'a'
a = A()
print type( a )
Now if I test against the instance type like I would for integer,
strings and the likes:
isinstance( a, instance )
NameError: name 'instance' is not defined
So I'm a bit at a loss here. I don't want to know if the instance is
an instance of a specific class, I just want to know if it's an
More information about the Tutor