> Is it possible to have method names of a class generated somehow dynamically?

If you don't know the name of the method ahead of time, how do you write 
the code for it? Do you use some dummy name? If so, once you have the 
name determined then you could use setattr to set the method name. 
Here's a simple example:

class MyClass:
     def DummyMethodName(self): pass

setattr(MyClass,'NewMethodName',MyClass.DummyMethodName)

-Farshid
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to