"my brain hurts" or is isinstance broken?

Martin v. Löwis loewis at informatik.hu-berlin.de
Thu Jul 4 05:50:51 EDT 2002


robert_kuzelj at yahoo.com (Robert Kuzelj) writes:

> lets simply say: the requirement is exactly to destinguish between
> instances and classes.

There is no difference between instances and classes. Classes are
objects that are callable, but there are also other objects that are
callable.

In Python 2.2, an object is called "a class" (or, more precisely, "an
old-style class") if its type is ClassType. An object is called "a
type" (or "a new-style class") it its type is TypeType.

Apart from that, there is nothing special about classes, compared to,
say, strings.

Regards,
Martin




More information about the Python-list mailing list