[Python-Dev] Deprecating "instance method" class

Jeroen Demeyer J.Demeyer at UGent.be
Thu Apr 4 07:51:40 EDT 2019


During my investigations related to low-level function/method classes, I 
came across the "instance method" class. There is a C API for it: 
https://docs.python.org/3.7/c-api/method.html
However, it's not used/exposed anywhere in CPython, except as 
_testcapi.instancemethod (for testing its functionality)

This class was discussed at 
https://mail.python.org/pipermail/python-3000/2007-December/011456.html 
and implemented in https://bugs.python.org/issue1587
Reading that old thread, there are use cases presented related to 
classic classes, wrapping Kogut 
(http://kokogut.sourceforge.net/kogut.html) objects and Pyrex. But 
classic classes no longer exist and the latter two use cases aren't 
actually needed if you read the thread to the end. So there are no 
surviving use cases from that thread.

Does anybody know actual use cases or any code in the wild using it? To 
me, the fact that it's only exposed in the C API is a good sign that 
it's not really useful.

So, should we deprecate the instance method class?


Jeroen.


More information about the Python-Dev mailing list