Skip to content

3.12 regression: cannot create weak reference to 'typing.TypeVar' object #106403

Description

@encukou

This works in Python 3.11, but fails in 3.12b3:

import weakref
import typing
weakref.ref(typing.TypeVar('T'))

I'm assuming it's an unintentional side effect of the PEP-695 implementation? Unfortunately I don't have time to investigate right now, let me know if I should.

Reported in cloudpipe/cloudpickle#507

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

3.12only security fixes3.13bugs and security fixestopic-typingtype-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions