Adding a method to an instance: solution

Bryan Mongeau bryan at eevolved.com
Sat Mar 3 16:35:16 CET 2001


In case anyone is wondering:

 import new

  def newMethod(self):
     # whatever

  f.newMethod = new.instancemethod(newMethod, f, f.__class__)


Thanks to Paul Foley on this one and thank you all for the advice.

Regards,
-- 
<=====================================>
Bryan Mongeau
Lead Developer, Director
eEvolved Real-Time Technologies Inc.
Website:    http://www.eevolved.com
Public key: http://eevolved.com/bcm.pk
<=====================================>

"To say that the mind is "just molecular machines" is like saying that the 
Mona Lisa is "just dabs of paint". Such statements confuse the parts with 
the whole, and confuse matter with the pattern it embodies. We are no less 
human for being made of molecules." -- K. Eric Drexler




More information about the Python-list mailing list