Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:
I presume you aren't referring to this: from types import MethodType > There really isn't anything else to say about it How about starting with why you want this and what you will do with it? According to this post on StackOverflow: https://stackoverflow.com/questions/40876368/where-can-i-find-an-instancemethod-in-the-python-3-standard-library The name instancemethod looks a lot like a bound method object, but it turns out it's something else entirely. It's a weird internal thing that, according to its documentation, is supposed to be the new way for C types to represent their methods, except that the standard C-level API for creating a type doesn't actually use it. According to conversations on the Python issue tracker, this feature was requested by the developers of Cython and Pyrex. Given that this is not used anywhere in CPython, the documentation for the C API specifically says it is not exposed to Python code, and the name is painfully misleading, we should assume that it is undocumented for a reason. It might help to persuade the core devs to expose it as part of the public Python API if you have a use-case for this. (And if so, I think it desperately needs to change the displayed name away from "instancemethod", since that's not what it returns.) See also #28842 ---------- nosy: +steven.daprano _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35937> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com