[Python-Dev] CALL_ATTR patch (was: 2.3b1 release)

Guido van Rossum guido@python.org
Fri, 18 Apr 2003 09:21:02 -0400


> > There are two ways to "bind" a built-in function to an object.
> > 
> > One would be to do what happens for Python functions, which is in
> > effect a currying: f.__get__(obj) yields a function g that when called
> > as g(arg1, ...) calls f(obj, arg1, ...).
> 
> That's the one I'm talking about. I forgot to explain that the problem
> occurs when I'm creating a *Python* class object and populating it
> with functions that are supposed to be methods. Currently I have to
> manually wrap each function in an unbound method object before putting
> it in the class's __dict__. If that happened automatically on access,
> I would be able to create Python classes that behave more like the
> real thing.

OK, are you up for submitting a patch?

--Guido van Rossum (home page: http://www.python.org/~guido/)