OK, now *this* is cool

Martin von Loewis loewis at informatik.hu-berlin.de
Sat Dec 8 10:31:20 EST 2001


Ype Kingma <ykingma at accessforall.nl> writes:

> P.S. Did they really make __subclasses__() a method?

Yes. Each type holds a list of weak references to its subtypes, to
avoid creating cycles. If you want a list of all subclasses, you need
to go through the weak references and find those which are still
live. The list you get will be different from what is in the type
object; the function call will remind you that some computation is
going on.

Regards,
Martin



More information about the Python-list mailing list