This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: PyInstanceMethod_Type isn't hashable
Type: enhancement Stage:
Components: Interpreter Core Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: josh.r, wolever
Priority: normal Keywords:

Created on 2016-11-30 18:26 by wolever, last changed 2022-04-11 14:58 by admin.

Messages (2)
msg282091 - (view) Author: David Wolever (wolever) * (Python committer) Date: 2016-11-30 18:26
The PyInstanceMethod_Type, unlike all other method types, isn't hashable.

It seems like the code exists, it's just been commented out: https://github.com/python/cpython/blame/c30098c8c6014f3340a369a31df9c74bdbacc269/Objects/classobject.c#L569

This came up here: https://github.com/wolever/pprintpp/issues/18

And Christian Heimes doesn't remember why it was commented out: https://twitter.com/ChristianHeimes/status/803900655324790784
msg282094 - (view) Author: Josh Rosenberg (josh.r) * (Python triager) Date: 2016-11-30 19:32
Note: It's a little strange that instancemethod as a type sticks around even though literally nothing in Python uses it. Is there some reason we kept it in the 3.x transition? Extension types are using it, so I guess we can't drop it now, but I'm trying to figure out why it was kept around, allowing the extensions to develop dependencies on it.
History
Date User Action Args
2022-04-11 14:58:40adminsetgithub: 73028
2021-11-30 16:58:14iritkatrielsetcomponents: + Interpreter Core
2021-11-30 16:56:16iritkatrielsettype: behavior -> enhancement
versions: + Python 3.11, - Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
2016-11-30 19:32:56josh.rsetnosy: + josh.r
messages: + msg282094
2016-11-30 18:26:33wolevercreate