noro wrote: > Is it possible to do the following: > > for a certain class: [...] > 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
Something like this? >>> class C: ... def f1(self): ... print "i'm one" ... def f2(self): ... print "i'm two" ... >>> obj = C() >>> d = {'one': obj.f1, 'two': obj.f2} >>> d['one']() i'm one >>> d['two']() i'm two -- Roberto Bonvallet -- http://mail.python.org/mailman/listinfo/python-list