I'd like to point out to the OP that using a function's __get__ method this way only works with new-style classes and their instances...not with the example in the shown in original post.
-Martin Alex Martelli wrote: > Flavio <[EMAIL PROTECTED]> wrote: > > > This "new" module sounds pretty cool, too bad its deprecated... > > > > I would not want to add a dependancy to a deprecated module in my code. > > But maybe I'll check the code for instancemethod within it and see what > > it does. > > If you have a function f and want to make an instancemethod out of it, > you can simply call f.__get__(theinstance, theclass) and that will build > and return the new instancemethod you require. > > > Alex -- http://mail.python.org/mailman/listinfo/python-list