[Python-ideas] Removing instancemethod in favor of partial?

Brett Cannon brett at python.org
Tue Apr 24 19:54:39 CEST 2007

On 4/24/07, Calvin Spealman <ironfroggy at gmail.com> wrote:
> Hey, why not? They do basically the same thing, except instancemethod
> allows only a single argument. Why not allow class and instance
> methods to be wrapped with a partial instead of their own type? We can
> rip out 300 lines of C code supporting instance method, at least. The
> only thorn is the im_class attribute, but few seem to even use it (few
> meaning just Twisted, according to Google Code Search). Anyway, I
> figure we don't really need it anyway because if some of the proposals
> for a way to reliably get the current function, class, or module go
> through, perhaps we'll have a reference to the class from the function
> itself. What does anyone think?

Huh, interesting idea.  In theory it seems fine.  I would want to know
if any performance penalty exists from this first, though.


More information about the Python-ideas mailing list