Best way to enumerate classes in a module

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Fri Jun 26 05:10:15 EDT 2009


On Thu, 25 Jun 2009 11:30:03 -0500, Nick Craig-Wood wrote:

>>  Something makes me think that module.__dict__ was only added to Python
>>  fairly recently, but I'm not sure.
> 
> It exists in python2.1 - I don't have an older python to check at the
> moment.

$ python1.5
Python 1.5.2 (#1, Apr  1 2009, 22:55:54)  [GCC 4.1.2 20070925 (Red Hat 
4.1.2-27)] on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import math
>>> len(math.__dict__)
27



-- 
Steven



More information about the Python-list mailing list