Message335074
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 |
|
Date |
User |
Action |
Args |
2019-02-08 12:02:40 | steven.daprano | set | recipients:
+ steven.daprano, ronaldoussoren, bup |
2019-02-08 12:02:39 | steven.daprano | set | messageid: <1549627359.3.0.61506466201.issue35937@roundup.psfhosted.org> |
2019-02-08 12:02:39 | steven.daprano | link | issue35937 messages |
2019-02-08 12:02:39 | steven.daprano | create | |
|