Re: dynamically inserting function into an object

2005-01-14 Thread michael . bierenfeld
*damn* it :-) python rocks. thx michael .oO (resetting c/c++/java crap collected over the years) -- http://mail.python.org/mailman/listinfo/python-list

Re: dynamically inserting function into an object

2005-01-13 Thread John Roth
If what you want is to insert a method into an instance, look at new.instancemethod. John Roth michael [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, below is a snipplet that could be seen as a part of a spreadsheet with getter and setter properties and a way how to dynamically

Re: dynamically inserting function into an object

2005-01-13 Thread hanz
# class Cell(object): # def __init__(self, initialvalue = 0): #self._func = lambda x: x #self.__value = initialvalue # # def setvalue (self, newvalue): # self.__value = self._func(newvalue) # # def getvalue (self): # return self.__value # # def