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

add __weakref__ to types.GenericAlias #86498

Closed
Tinche mannequin opened this issue Nov 12, 2020 · 5 comments
Closed

add __weakref__ to types.GenericAlias #86498

Tinche mannequin opened this issue Nov 12, 2020 · 5 comments
Labels
3.9 only security fixes 3.10 only security fixes type-feature A feature request or enhancement

Comments

@Tinche
Copy link
Mannequin

Tinche mannequin commented Nov 12, 2020

BPO 42332
Nosy @gvanrossum, @Tinche, @miss-islington, @Fidget-Spinner
PRs
  • bpo-42332: Add weakref slot to types.GenericAlias #23250
  • [3.9] bpo-42332: Add weakref slot to types.GenericAlias (GH-23250) #23309
  • 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 = <Date 2020-11-17.22:53:26.216>
    created_at = <Date 2020-11-12.12:04:09.556>
    labels = ['type-feature', '3.9', '3.10']
    title = 'add __weakref__ to types.GenericAlias'
    updated_at = <Date 2020-11-17.22:53:26.215>
    user = 'https://github.com/Tinche'

    bugs.python.org fields:

    activity = <Date 2020-11-17.22:53:26.215>
    actor = 'gvanrossum'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-11-17.22:53:26.216>
    closer = 'gvanrossum'
    components = []
    creation = <Date 2020-11-12.12:04:09.556>
    creator = 'tinchester'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 42332
    keywords = ['patch']
    message_count = 5.0
    messages = ['380816', '380834', '380836', '381060', '381301']
    nosy_count = 4.0
    nosy_names = ['gvanrossum', 'tinchester', 'miss-islington', 'kj']
    pr_nums = ['23250', '23309']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue42332'
    versions = ['Python 3.9', 'Python 3.10']

    @Tinche
    Copy link
    Mannequin Author

    Tinche mannequin commented Nov 12, 2020

    For example, dict[int, int] cannot be used with singledispatch because types.GenericAlias doesn't support weak references.

    I'm an author of a third party library (https://github.com/Tinche/cattrs) for which this functionality would be useful.

    Here's a similar issue in typing (note that this issue is for *types*.GenericAlias) that was fixed: python/typing#345

    @Tinche Tinche mannequin added 3.9 only security fixes 3.10 only security fixes type-feature A feature request or enhancement labels Nov 12, 2020
    @Tinche
    Copy link
    Mannequin Author

    Tinche mannequin commented Nov 12, 2020

    It would be great if we could get this into 3.9.

    @gvanrossum
    Copy link
    Member

    I think it's reasonable to consider this a bug to be fixed.

    @miss-islington
    Copy link
    Contributor

    New changeset 384b7a4 by kj in branch 'master':
    bpo-42332: Add weakref slot to types.GenericAlias (GH-23250)
    384b7a4

    @miss-islington
    Copy link
    Contributor

    New changeset 71ba5f5 by kj in branch '3.9':
    [3.9] bpo-42332: Add weakref slot to types.GenericAlias (GH-23250) (GH-23309)
    71ba5f5

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes 3.10 only security fixes type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants