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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -