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

Implement PEP 655 (Required/NotRequired) #91243

Closed
JelleZijlstra opened this issue Mar 21, 2022 · 6 comments
Closed

Implement PEP 655 (Required/NotRequired) #91243

JelleZijlstra opened this issue Mar 21, 2022 · 6 comments
Labels
3.11 only security fixes stdlib Python modules in the Lib dir topic-typing type-feature A feature request or enhancement

Comments

@JelleZijlstra
Copy link
Member

BPO 47087
Nosy @gvanrossum, @davidfstr, @JelleZijlstra, @Fidget-Spinner, @AlexWaygood
PRs
  • gh-91243: Add typing.Required and NotRequired (PEP 655) #32419
  • 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 2022-03-21.21:18:31.184>
    labels = ['type-feature', 'library', '3.11']
    title = 'Implement PEP 655 (Required/NotRequired)'
    updated_at = <Date 2022-04-08.16:10:23.222>
    user = 'https://github.com/JelleZijlstra'

    bugs.python.org fields:

    activity = <Date 2022-04-08.16:10:23.222>
    actor = 'JelleZijlstra'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2022-03-21.21:18:31.184>
    creator = 'JelleZijlstra'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 47087
    keywords = ['patch']
    message_count = 1.0
    messages = ['415704']
    nosy_count = 5.0
    nosy_names = ['gvanrossum', 'David Foster', 'JelleZijlstra', 'kj', 'AlexWaygood']
    pr_nums = ['32419']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue47087'
    versions = ['Python 3.11']

    @JelleZijlstra
    Copy link
    Member Author

    PEP-655 was just accepted, so we should implement it in typing.py! We should be able to largely reuse the typing-extensions implementation.

    (I can't find David Foster on BPO but I'll point him to this issue.)

    @JelleZijlstra JelleZijlstra added 3.11 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Mar 21, 2022
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    JelleZijlstra added a commit that referenced this issue Apr 12, 2022
    I talked to @davidfstr and I offered to implement the runtime part of PEP 655
    to make sure we can get it in before the feature freeze. We're going to defer
    the documentation to a separate PR, because it can wait until after the feature
    freeze.
    
    The runtime implementation conveniently already exists in typing-extensions,
    so I largely copied that.
    
    Co-authored-by: David Foster <david@dafoster.net>
    @JelleZijlstra
    Copy link
    Member Author

    I just merged #32419 to provide the runtime implementation. We still need documentation.

    @davidfstr
    Copy link
    Contributor

    (I'm planning to pick up the documentation piece here within the next 2 weeks)

    @davidfstr
    Copy link
    Contributor

    (I'm currently drafting typing module documentation related to Required and NotRequired. Should have first draft ready for review sometime this week.)

    davidfstr added a commit to davidfstr/cpython that referenced this issue May 24, 2022
    JelleZijlstra pushed a commit that referenced this issue May 27, 2022
    Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
    miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 27, 2022
    Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
    (cherry picked from commit 711eda7)
    
    Co-authored-by: David Foster <david@dafoster.net>
    miss-islington added a commit that referenced this issue May 27, 2022
    Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
    (cherry picked from commit 711eda7)
    
    Co-authored-by: David Foster <david@dafoster.net>
    @davidfstr
    Copy link
    Contributor

    Runtime implementation and documentation for Required/NotRequired is complete. 🎉

    I believe this issue can be closed.

    @AlexWaygood
    Copy link
    Member

    @davidfstr congratulations!

    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 topic-typing type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants