functions, classes, bound, unbound?

irstas at gmail.com irstas at gmail.com
Sun Mar 25 05:00:27 EDT 2007


On Mar 25, 9:13 am, "7stud" <bbxx789_0... at yahoo.com> wrote:
> MyClass.someFunc
>
> Is there some other way to retrieve a user-defined function object
> from a class other than using the class name or an instance?

What Steven B. already said, MyClass.__dict__['someFunc'], is a
different way than MyClass.someFunc that produces different results.
Since the method is an attribute of a class, what other kinds of means
are you expecting to be possible?

You can use reflection to dig up MyClass-object from the module
dictionary if referring to object or class by name in the code is
something you want to get rid of.




More information about the Python-list mailing list