how to list the attributes of a class, not an object?

2010-01-24 Thread Robert P. J. Day
once again, probably a trivial question but i googled and didn't get an obvious solution. how to list the attributes of a *class*? eg., i was playing with dicts and noticed that the type returned by the keys() method was dict_keys. so i'm now curious as to the attributes of the dict_keys

Re: how to list the attributes of a class, not an object?

2010-01-24 Thread Alf P. Steinbach
* Robert P. J. Day: once again, probably a trivial question but i googled and didn't get an obvious solution. how to list the attributes of a *class*? eg., i was playing with dicts and noticed that the type returned by the keys() method was dict_keys. so i'm now curious as to the

Re: how to list the attributes of a class, not an object?

2010-01-24 Thread Jan Kaliszewski
24-01-2010, 16:28:26 Robert P. J. Day rpj...@crashcourse.ca wrote once again, probably a trivial question but i googled and didn't get an obvious solution. how to list the attributes of a *class*? dir(type(an_obj)) or more reliable: list(vars(type(an_obj))) (dir() uses __dir__

Re: how to list the attributes of a class, not an object?

2010-01-24 Thread Robert P. J. Day
On Sun, 24 Jan 2010, Alf P. Steinbach wrote: * Robert P. J. Day: once again, probably a trivial question but i googled and didn't get an obvious solution. how to list the attributes of a *class*? eg., i was playing with dicts and noticed that the type returned by the keys() method

Re: how to list the attributes of a class, not an object?

2010-01-24 Thread Alf P. Steinbach
* Robert P. J. Day: On Sun, 24 Jan 2010, Alf P. Steinbach wrote: * Robert P. J. Day: once again, probably a trivial question but i googled and didn't get an obvious solution. how to list the attributes of a *class*? eg., i was playing with dicts and noticed that the type returned by the

Re: how to list the attributes of a class, not an object?

2010-01-24 Thread Jan Kaliszewski
24-01-2010, 17:37:41 Alf P. Steinbach al...@start.no wrote: DictKeys = type( {}.keys() ) dir( DictKeys ) list( vars( DictKeys ) ) help( DictKeys ) It doesn't help much though because the only method of interrest is __iter__ Not only. Please, consider: dictkeys =