Re: Dynamic method parameter access?

2008-02-14 Thread Dennis Kempin
Chris schrieb: > On Feb 12, 9:38 pm, Dennis Kempin <[EMAIL PROTECTED]> wrote: >> Hello, >> >> I have a set of some objects. With these objects I want to call a Python >> method. But the writer of the method shall have the option to select >> from these ob

Re: How to access object attributes given a string

2008-02-12 Thread Dennis Kempin
Santiago Romero schrieb: > Hi... > > I'm trying to guess how to access attributes of an existing object > given the attribute name in a string. I mean: > > class Object: > self.x = 12 > self.y = 20 > self.name = "blah" > > def ChangeAttribute( object, attribute, value ): > # Inse

Dynamic method parameter access?

2008-02-12 Thread Dennis Kempin
Hello, I have a set of some objects. With these objects I want to call a Python method. But the writer of the method shall have the option to select from these objects as method parameter. At the moment i use the following way to call a method with the a or b or both parameter. try: meth