How to check class equality in Python 2.5? -
i've looked through python 2.5 documentation , couldn't find answer this: how check if object same class object?
def isclass(obj1, obj2): return obj1.class == obj2.class #doesn't work
you can use
type(obj1) type(obj2)
note try avoid type checking in python, rather rely on duck typing.
Comments
Post a Comment