Trying to generate a list of the subclasses of C
cdkrug at aol.com
Thu Jan 19 00:59:00 CET 2006
On 2006-01-16, Alex Martelli <aleax at mail.comcast.net> wrote:
> Charles Krug <cdkrug at aol.com> wrote:
>> I'm trying to create a list of all of C's subclasses:
> There's a class method for that very purpose:
>>>> class C(object): pass
>>>> class D(C): pass
>>>> class E(C): pass
> [<class '__main__.D'>, <class '__main__.E'>]
Exactly what I was looking for, thanks.
It stuck in my brain that there was a way to do this, but I couldn't lay
my mouse on it.
More information about the Python-list