How do I get type methods?

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Fri May 4 11:13:50 EDT 2007


In <1178289484.265718.198060 at c35g2000hsg.googlegroups.com>, Thomas Nelson
wrote:

> On May 4, 7:59 am, yavanna... at yahoo.com wrote:
>> Let me retype my question: what I 'dir()' in case of 'pyuno' type
>> instance?
>> Or in case of 'dict' type instance? Or in case of any other new python
>> type?
> 
>>>> class Foo:
> ...     def f(self,x):
> ...             print x+1
> ...     def g(self,x):
> ...             print x-1
> ...
>>>> dir(Foo)
> ['__doc__', '__module__', 'f', 'g']
> 
> Is this not what you want?  These are the only methods in the Foo
> class.

The OPs problem is, there is no access to the class or type because
there is no name.  You can get just instances from a factory function. 

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list