Finding all classes in a module

Emile van Sebille emile at fenx.com
Fri Aug 9 16:31:03 CEST 2002


"Donnal Walter" <donnal at donnal.net> wrote in message
news:918bc22f.0208090610.6c729bbd at posting.google.com...
> Jim Meier <jim at dsdd.org wrote in message news:<LwJ49.121080> import m
> >
> > for k,v in m.__dict__:
> > if isintance(v, types.ClassType):
> > print k
>
> Traceback (most recent call last):
>   File "<pyshell#11>", line 1, in ?
>     for k,v in graph.__dict__:
> ValueError: too many values to unpack

Redo w/__dict__.items():


>>> for k,v in sys.__dict__: print k,v; break
...
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: too many values to unpack
>>> for k,v in sys.__dict__.items(): print k,v; break
...
setrecursionlimit <built-in function setrecursionlimit>
>>>


--

Emile van Sebille
emile at fenx.com

---------




More information about the Python-list mailing list