What is the class of myobj?

JXStern JXSternChangeX2R at gte.net
Wed Oct 16 02:36:39 CEST 2002

I want to write something like:

If ClassOf(myobj) == "MyClass": print "OK!"
If ClassOf(myobj) == MyClass: print "OK!"   # no quotes on class

The best I've found in Python is based on str(myobj.__class__).

What's the official way?


Newbie still,
Joshua Stern

More information about the Python-list mailing list