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 support for PEP 646 #87390

Closed
mrahtz mannequin opened this issue Feb 14, 2021 · 17 comments
Closed

Add support for PEP 646 #87390

mrahtz mannequin opened this issue Feb 14, 2021 · 17 comments
Labels
3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) stdlib Python modules in the Lib dir tests Tests in the Lib/test dir topic-typing type-feature A feature request or enhancement

Comments

@mrahtz
Copy link
Mannequin

mrahtz mannequin commented Feb 14, 2021

BPO 43224
Nosy @gvanrossum, @serhiy-storchaka, @JelleZijlstra, @lysnikolaou, @pablogsal, @Fidget-Spinner, @mrahtz, @mrahtz, @AlexWaygood, @cdce8p
PRs
  • bpo-43224: Initial implementation of PEP 646 in typing.py #24527
  • bpo-43224: Draft implementation of PEP 646 #30398
  • bpo-43224: Implement PEP 646 grammar changes #31018
  • bpo-43224: Implement PEP 646 changes to genericaliasobject.c #31019
  • bpo-43224: Implement PEP 646 changes to typing.py #31021
  • bpo-43224: Implement substitution of unpacked TypeVarTuple #31800
  • bpo-43224: Work around substitution of unpacked TypeVarTuple #31804
  • bpo-43224: Implement substitution of unpacked TypeVarTuple in C #31828
  • bpo-43224: Add more tests for typevar substitution #31844
  • bpo-43224: Fix Tuple[()].__args__ #31845
  • bpo-43224: Add tests for TypeVarTuple substitution in Annotated #31846
  • bpo-43224: Add TypeVarTuple.__name__ #31954
  • bpo-43224: Unpack concrete tuple types into a sequence of types #32030
  • bpo-43224: Forbid TypeVar substitution with Unpack #32031
  • bpo-43224: Implement pickling of TypeVarTuples #32119
  • bpo-43224: Add tests for pickling and copying of unpacked native tuple #32159
  • 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 2021-02-14.17:21:47.204>
    labels = ['interpreter-core', 'tests', 'library', '3.11']
    title = 'Add support for PEP 646'
    updated_at = <Date 2022-04-05.02:52:50.682>
    user = 'https://github.com/mrahtz'

    bugs.python.org fields:

    activity = <Date 2022-04-05.02:52:50.682>
    actor = 'JelleZijlstra'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)', 'Tests', 'Parser']
    creation = <Date 2021-02-14.17:21:47.204>
    creator = 'mrahtz'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43224
    keywords = ['patch']
    message_count = 9.0
    messages = ['414715', '414935', '414991', '415514', '416020', '416022', '416074', '416689', '416727']
    nosy_count = 10.0
    nosy_names = ['gvanrossum', 'serhiy.storchaka', 'JelleZijlstra', 'lys.nikolaou', 'pablogsal', 'kj', 'matthew.rahtz', 'mrahtz', 'AlexWaygood', 'cdce8p']
    pr_nums = ['24527', '30398', '31018', '31019', '31021', '31800', '31804', '31828', '31844', '31845', '31846', '31954', '32030', '32031', '32119', '32159']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue43224'
    versions = ['Python 3.11']

    @mrahtz mrahtz mannequin added 3.10 only security fixes stdlib Python modules in the Lib dir labels Feb 14, 2021
    @mrahtz mrahtz mannequin added tests Tests in the Lib/test dir interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.11 only security fixes and removed 3.10 only security fixes labels Jan 4, 2022
    @mrahtz mrahtz mannequin changed the title Add support for PEP 646 (Variadic Generics) to typing.py Add support for PEP 646 Jan 4, 2022
    @mrahtz mrahtz mannequin added 3.11 only security fixes and removed 3.10 only security fixes labels Jan 4, 2022
    @mrahtz mrahtz mannequin changed the title Add support for PEP 646 (Variadic Generics) to typing.py Add support for PEP 646 Jan 4, 2022
    @JelleZijlstra
    Copy link
    Member

    New changeset 7a793a3 by Matthew Rahtz in branch 'main':
    bpo-43224: Implement PEP-646 changes to typing.py (GH-31021)
    7a793a3

    @serhiy-storchaka
    Copy link
    Member

    New changeset 5b1b9ea by Serhiy Storchaka in branch 'main':
    bpo-43224: Implement substitution of unpacked TypeVarTuple (GH-31800)
    5b1b9ea

    @Fidget-Spinner
    Copy link
    Member

    New changeset af2277e by Matthew Rahtz in branch 'main':
    bpo-43224: Implement PEP-646 changes to genericaliasobject.c (GH-31019)
    af2277e

    @JelleZijlstra
    Copy link
    Member

    New changeset 3a2b895 by Jelle Zijlstra in branch 'main':
    bpo-43224: Add TypeVarTuple.__name__ (GH-31954)
    3a2b895

    @mrahtz
    Copy link
    Mannequin Author

    mrahtz mannequin commented Mar 25, 2022

    Since things are piling up, here's a quick record of what I think the remaining tasks are: (in approximate order of priority)

    1. Finish writing docs (is updating library/typing.html sufficient? bpo-47097: Add documentation for TypeVarTuple #32103)
    2. Implement support for pickling of unpacked native tuples
    3. Implement support and add tests for copy() of TypeVarTuple and unpacked tuple
    4. Resolve the issue of how we implement type substitution (https://bugs.python.org/issue47006)

    @JelleZijlstra
    Copy link
    Member

    1. Finish writing docs (is updating library/typing.html sufficient? bpo-47097: Add documentation for TypeVarTuple #32103)

    We also need to add to the What's New for 3.11. I volunteered to do that for all the typing PEPs.

    1. Implement support for pickling of unpacked native tuples

    Linking your #76300

    1. Implement support and add tests for copy() of TypeVarTuple and unpacked tuple

    I believe this uses the same mechanism as pickling, so shouldn't need more work.

    @JelleZijlstra
    Copy link
    Member

    New changeset e8e737b by Matthew Rahtz in branch 'main':
    bpo-43224: Implement PEP-646 grammar changes (GH-31018)
    e8e737b

    @mrahtz
    Copy link
    Mannequin Author

    mrahtz mannequin commented Apr 4, 2022

    1. Finish writing docs

    Done once #32103 is merged.

    1. Implement support for pickling of unpacked native tuples

    Done once #32159 is merged.

    1. Resolve the issue of how we implement type substitution (https://bugs.python.org/issue47006)

    Will re-visit this now.

    @JelleZijlstra
    Copy link
    Member

    New changeset 772d808 by Matthew Rahtz in branch 'main':
    bpo-43224: typing: Add tests for pickling and copying of unpacked native tuple (GH-32159)
    772d808

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @gvanrossum
    Copy link
    Member

    @mrahtz @JelleZijlstra @serhiy-storchaka Is it okay if I unsubscribe from these conversations and let you all come up with a compromise? I feel that while we ought to have a policy formulated and mostly implemented by beta 1 (May 6), tweaks of both the policy and the implementation during the beta period until RC 1 (Aug/Sept?) should be allowable.

    @mrahtz
    Copy link
    Contributor

    mrahtz commented Apr 11, 2022

    @gvanrossum Fine with me. Godspeed with the rest of your work for this release :)

    @AlexWaygood AlexWaygood added topic-typing type-feature A feature request or enhancement labels Apr 13, 2022
    @mrahtz
    Copy link
    Contributor

    mrahtz commented Apr 20, 2022

    Keeping track of things yet to do:

    Decided against doing:

    • Disallow Unpack[Tuple] - I think it's simpler if we keep this valid, in accordance with the the general philosophy of "Keep the runtime lenient when it comes to typing"

    @hauntsaninja
    Copy link
    Contributor

    How much of the checklist above is still relevant?

    @mrahtz
    Copy link
    Contributor

    mrahtz commented Oct 11, 2022

    Thanks for the reminder! From a quick look, some of the items in the checklist are definitely still relevant. I'll try and find some time for this soon.

    JelleZijlstra pushed a commit that referenced this issue Oct 25, 2022
    Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
    JelleZijlstra pushed a commit to JelleZijlstra/cpython that referenced this issue Oct 25, 2022
    Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>.
    (cherry picked from commit cb95cc2)
    
    Co-authored-by: Matthew Rahtz <matthew.rahtz@gmail.com>
    JelleZijlstra added a commit that referenced this issue Oct 26, 2022
    Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>.
    Co-authored-by: Matthew Rahtz <matthew.rahtz@gmail.com>
    
    (cherry picked from commit cb95cc2)
    @AlexWaygood
    Copy link
    Member

    Thanks for the reminder! From a quick look, some of the items in the checklist are definitely still relevant. I'll try and find some time for this soon.

    Friendly ping on this -- are the unchecked items on the checklist still to do, or is this issue ~complete now? :)

    @mrahtz
    Copy link
    Contributor

    mrahtz commented Apr 10, 2023

    Whoops, sorry - we finished #98267 last year but I completely forgot to update the checklist. I believe we can go ahead and close this now :) (though I can't seem to do this myself because the issue was created before the move to GitHub or something? Can you do it on your end?)

    @AlexWaygood
    Copy link
    Member

    Whoops, sorry - we finished #98267 last year but I completely forgot to update the checklist. I believe we can go ahead and close this now :)

    No worries -- great to hear!

    Can you do it on your end?)

    I sure can. Thanks for all the work you put into this, it was a marathon!

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) stdlib Python modules in the Lib dir tests Tests in the Lib/test dir topic-typing type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    7 participants