Re: new.instancemethod questions

2009-01-29 Thread schickb
On Jan 29, 8:51 pm, Brian Allen Vanderburg II wrote: > You can also create a bound method and manually bind it to the > instance.  This is easier > > import types > a.f2 = types.MethodType(f1, a) > > a.f2() # prints object a Ah thanks, that is what I was looking for. I missed that because followi

Re: new.instancemethod questions

2009-01-29 Thread Brian Allen Vanderburg II
schi...@gmail.com wrote: On Jan 29, 7:38 pm, Mel wrote: schickb wrote: I'd like to add bound functions to instances, and found the instancemethod function in the new module. A few questions: 1. Why is instancemethod even needed? Its counter-intuitive (to me at least) that assig

Re: new.instancemethod questions

2009-01-29 Thread schickb
On Jan 29, 7:38 pm, Mel wrote: > schickb wrote: > > I'd like to add bound functions to instances, and found the > > instancemethod function in the new module. A few questions: > > > 1. Why is instancemethod even needed? Its counter-intuitive (to me at > > least) that assigning a function to a clas

Re: new.instancemethod questions

2009-01-29 Thread Mel
schickb wrote: > I'd like to add bound functions to instances, and found the > instancemethod function in the new module. A few questions: > > 1. Why is instancemethod even needed? Its counter-intuitive (to me at > least) that assigning a function to a class results in bound functions > its insta