[Python-3000] Unbound methods -- keep creating API?
Christian Heimes
lists at cheimes.de
Sun Nov 25 12:29:41 CET 2007
Georg Brandl wrote:
> We've made class.function return a function, but the unbound method machinery
> is still alive. For example, you can still create unbound methods with
> new.instancemethod and PyMethod_New, and there's bits of code in classobject.c
> that refers to unbound methods.
Removing unbound methods also removes an obscure way to rebind internal
C functions to classes:
class Example:
pass
Example.id = new.instancemethod(id, None, Example)
Now Example().id() has the same effect as:
class Example:
def id(self):
return id(self)
Do we need this feature?
Christian
More information about the Python-3000
mailing list