Skip to content

PyInstanceMethod_Type isn't hashable #73028

Open

Description

@wolever
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']

Activity

  1. wolever commented on Nov 30, 2016

    @wolever
    MemberAuthor

    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

  2. added
    type-bug
    3.7 (EOL)
    on Nov 30, 2016
  3. MojoVampire commented on Nov 30, 2016

    MojoVampiremannequin
    Mannequin

    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.

  4. added
    3.11
    type-feature
    interpreter-core
    and removed
    3.7 (EOL)
    type-bug
    on Nov 30, 2021
  5. transferred this issue fromon Apr 10, 2022
  6. hugovk commented on Feb 28, 2024

    @hugovk
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11interpreter-coretype-feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions