On 30 Aug 2006 06:35:17 -0700 "noro" <[EMAIL PROTECTED]> wrote:
> Is it possible to do the following: > > for a certain class: > > ---------------------------- > class C: > > def func1(self): > pass > def func2(self): > pass > def func4(self): > pass > > obj=C() > ---------------------------- > > by some way create a dictionary that look somthing like that: > > d= {'function one': <reference to C.func1()>, \ > 'function two': <reference to C.func2()>, \ > 'function three': <reference to C.func3()>} > > and so i could access every method of instances of C, such as obj with > sometiing like: > (i know that this syntax wont work ) > > obj.(d['function one']) > obj.(d['function two']) > etc.. > Sure. But the syntax would be: d['function one'] = c.func1 d['function one']() I'm not sure what this gets you but it works. John Purser -- http://mail.python.org/mailman/listinfo/python-list