[IronPython] Method invocation when assigned to instancediffers from default assignment?

Nicholas Riley njriley at uiuc.edu
Sat Feb 17 21:40:55 CET 2007

On Sat, Feb 17, 2007 at 11:50:57AM -0800, Erzengel des Lichtes wrote:
> OK, looking into my original code, Test.Func1 was a Function, Test.Func2 was
> a Bound Method, and MyClass.Func2 was an unbound method.
> My question then is: Why is Test.Func1 not a bound method?

Bound methods are only created if the method is defined on the class,
then accessed through an instance.  If the method is defined on the
instance, there's no need to bind it to an instance because it is
already instance-specific.

I hope that makes sense.

Nicholas Riley <njriley at uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>

More information about the Ironpython-users mailing list