Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyInstanceMethod_Type isn't hashable #73028

Open
wolever opened this issue Nov 30, 2016 · 3 comments
Open

PyInstanceMethod_Type isn't hashable #73028

wolever opened this issue Nov 30, 2016 · 3 comments
Labels
3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@wolever
Copy link
Member

wolever commented Nov 30, 2016

BPO 28842
Nosy @wolever, @MojoVampire

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2016-11-30.18:26:33.954>
labels = ['interpreter-core', 'type-feature', '3.11']
title = "PyInstanceMethod_Type isn't hashable"
updated_at = <Date 2021-11-30.16:58:14.601>
user = 'https://github.com/wolever'

bugs.python.org fields:

activity = <Date 2021-11-30.16:58:14.601>
actor = 'iritkatriel'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Interpreter Core']
creation = <Date 2016-11-30.18:26:33.954>
creator = 'wolever'
dependencies = []
files = []
hgrepos = []
issue_num = 28842
keywords = []
message_count = 2.0
messages = ['282091', '282094']
nosy_count = 2.0
nosy_names = ['wolever', 'josh.r']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue28842'
versions = ['Python 3.11']

@wolever
Copy link
Member Author

wolever commented Nov 30, 2016

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: wolever/pprintpp#18

And Christian Heimes doesn't remember why it was commented out: https://twitter.com/ChristianHeimes/status/803900655324790784

@wolever wolever added type-bug An unexpected behavior, bug, or error 3.7 (EOL) end of life labels Nov 30, 2016
@MojoVampire
Copy link
Mannequin

MojoVampire mannequin commented Nov 30, 2016

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.

@iritkatriel iritkatriel added 3.11 only security fixes type-feature A feature request or enhancement interpreter-core (Objects, Python, Grammar, and Parser dirs) and removed 3.7 (EOL) end of life type-bug An unexpected behavior, bug, or error labels Nov 30, 2021
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@hugovk
Copy link
Member

hugovk commented Feb 28, 2024

It seems like the code exists, it's just been commented out: c30098c/Objects/classobject.c#L569 (blame)

The commented instancemethod_hash was removed in #31814.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants