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

typing._TypeVarLike missing __slots__ #90402

Closed
ariebovenberg mannequin opened this issue Jan 3, 2022 · 9 comments
Closed

typing._TypeVarLike missing __slots__ #90402

ariebovenberg mannequin opened this issue Jan 3, 2022 · 9 comments
Labels
3.11 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@ariebovenberg
Copy link
Mannequin

ariebovenberg mannequin commented Jan 3, 2022

BPO 46244
Nosy @gvanrossum, @Fidget-Spinner, @kumaraditya303, @AlexWaygood, @ariebovenberg
PRs
  • bpo-46244: Remove __slots__ from typing.TypeVar, .ParamSpec #30444
  • 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 2022-01-11.09:44:30.052>
    created_at = <Date 2022-01-03.14:47:44.608>
    labels = ['type-bug', 'library', '3.11']
    title = 'typing._TypeVarLike missing __slots__'
    updated_at = <Date 2022-01-11.09:44:30.052>
    user = 'https://github.com/ariebovenberg'

    bugs.python.org fields:

    activity = <Date 2022-01-11.09:44:30.052>
    actor = 'AlexWaygood'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-01-11.09:44:30.052>
    closer = 'AlexWaygood'
    components = ['Library (Lib)']
    creation = <Date 2022-01-03.14:47:44.608>
    creator = 'ariebovenberg'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46244
    keywords = ['patch']
    message_count = 9.0
    messages = ['409587', '409589', '409602', '409603', '409678', '409690', '410267', '410274', '410276']
    nosy_count = 5.0
    nosy_names = ['gvanrossum', 'kj', 'kumaraditya', 'AlexWaygood', 'ariebovenberg']
    pr_nums = ['30444']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue46244'
    versions = ['Python 3.11']

    @ariebovenberg
    Copy link
    Mannequin Author

    ariebovenberg mannequin commented Jan 3, 2022

    The mixin class "typing._TypeVarLike" has no __slots__. Its subclasses do define __slots__, so it looks like a mistake.

    Agree?

    It should be an easy fix, and I'd like to pick this up.

    @ariebovenberg ariebovenberg mannequin added 3.10 only security fixes performance Performance or resource usage 3.11 only security fixes stdlib Python modules in the Lib dir labels Jan 3, 2022
    @ariebovenberg
    Copy link
    Mannequin Author

    ariebovenberg mannequin commented Jan 3, 2022

    I've also encountered other classes in the stdlib possibly missing slots:

    • importlib.metadata.DeprecatedList (subclass EntryPoints has slots)
    • xml.dom.minidom.Node, xml.dom.xmlbuilder.DocumentLS (5 subclasses have slots)

    Will investigate.

    @gvanrossum
    Copy link
    Member

    Confirmed about _TypeVarLike. Go ahead and make a PR. Do add a news blurb when requested.

    Please open separate issues for other such classes, each fix may need to be reviewed by a different expert.

    @ariebovenberg
    Copy link
    Mannequin Author

    ariebovenberg mannequin commented Jan 3, 2022

    Thanks! I'll open new issues shortly on xml and importlib

    @Fidget-Spinner
    Copy link
    Member

    Good catch Arie. Would you like to submit a PR for this?

    @ariebovenberg
    Copy link
    Mannequin Author

    ariebovenberg mannequin commented Jan 4, 2022

    @kj I would very much like to! Seems like a good place to start contributing :)

    @Fidget-Spinner
    Copy link
    Member

    New changeset 081a214 by Arie Bovenberg in branch 'main':
    bpo-46244: Remove __slots__ from typing.TypeVar, .ParamSpec (bpo-30444)
    081a214

    @kumaraditya303
    Copy link
    Contributor

    Can this be closed now ?

    @kumaraditya303 kumaraditya303 removed the 3.10 only security fixes label Jan 11, 2022
    @gvanrossum
    Copy link
    Member

    Yes.--
    --Guido (mobile)

    @AlexWaygood AlexWaygood added type-bug An unexpected behavior, bug, or error and removed performance Performance or resource usage labels Jan 11, 2022
    @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.11 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants