Ben Finney schrieb: > Samuel <[EMAIL PROTECTED]> writes: > >> I remember seeing an easy way to list all subtypes of a specific type >> but I haven't been able to find it anymore. What I am trying to do is >> this: Given a class, get a list of all classes that derive from it. >> Pretty much like __mro__ but downwards rather then upwards. Any ideas? > > A class knows its parents; it doesn't know its children. (Or, in other > words, children need to know who their parents are, but aren't > required to notify their parents about anything.)
Not right. These special children are under a more demanding goverment. class A(object): pass class B(A): pass print A.__subclasses__() http://www.mail-archive.com/python-list@python.org/msg67979.html Diez -- http://mail.python.org/mailman/listinfo/python-list