> method or instancemethod perhaps?
The necessary code is already in Python 3.0's code base. I've added in
in r56469 as requested in my issue http://bugs.python.org/issue1587. It
seems we had this very discussion over two and a half year ago.
Index: Python/bltinmodule.c
===================================================================
--- Python/bltinmodule.c (Revision 81963)
+++ Python/bltinmodule.c (Arbeitskopie)
@@ -2351,6 +2351,7 @@
SETBUILTIN("frozenset", &PyFrozenSet_Type);
SETBUILTIN("property", &PyProperty_Type);
SETBUILTIN("int", &PyLong_Type);
+ SETBUILTIN("instancemethod", &PyInstanceMethod_Type);
SETBUILTIN("list", &PyList_Type);
SETBUILTIN("map", &PyMap_Type);
SETBUILTIN("object", &PyBaseObject_Type);
>>> class Example:
... iid = instancemethod(id)
... id = id
...
>>> Example().id()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: id() takes exactly one argument (0 given)
>>> Example().iid()
139941157882144
Christian
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com