Re: getting dir(x), but not as list of strings?

2008-05-21 Thread Terry Reedy
"Gary Herron" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | [EMAIL PROTECTED] wrote: | > I want to iterate over members of a module, something like: | > | > for i in dir(x): | > if type(i) == types.FunctionType: ... | > | > but of course dir() returns a list of strings

Re: getting dir(x), but not as list of strings?

2008-05-21 Thread Gary Herron
[EMAIL PROTECTED] wrote: I want to iterate over members of a module, something like: for i in dir(x): if type(i) == types.FunctionType: ... but of course dir() returns a list of strings. If x is a module, how can I get the list of its members as their actual types? Many TIA! Mark

Re: getting dir(x), but not as list of strings?

2008-05-21 Thread akeppke
Use for i in dir(x): print i# name of member as string print getattr(x, i)# member regards Arno On 21 Mai, 09:54, [EMAIL PROTECTED] wrote: > I want to iterate over members of a module, something like: > > for i in dir(x): > if type(i) ==

Re: getting dir(x), but not as list of strings?

2008-05-21 Thread Marc 'BlackJack' Rintsch
On Wed, 21 May 2008 07:54:32 +, mh wrote: > I want to iterate over members of a module, something like: > > for i in dir(x): > if type(i) == types.FunctionType: ... > > but of course dir() returns a list of strings. If x is a module, > how can I get the list of its members as th

getting dir(x), but not as list of strings?

2008-05-21 Thread mh
I want to iterate over members of a module, something like: for i in dir(x): if type(i) == types.FunctionType: ... but of course dir() returns a list of strings. If x is a module, how can I get the list of its members as their actual types? Many TIA! Mark -- Mark Harrison Pixar An