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

Open
mrahtz mannequin opened this issue Feb 14, 2021 · 12 comments
Open

Add support for PEP 646 #87390

mrahtz mannequin opened this issue Feb 14, 2021 · 12 comments
Labels
3.11 expert-typing interpreter-core stdlib tests type-feature

Comments

@mrahtz
Copy link
Mannequin

@mrahtz mrahtz mannequin commented Feb 14, 2021

BPO 43224
Nosy @gvanrossum, @serhiy-storchaka, @JelleZijlstra, @lysnikolaou, @pablogsal, @Fidget-Spinner, @mrahtz, @mrahtz, @AlexWaygood, @cdce8p
PRs
  • #24527
  • #30398
  • #31018
  • #31019
  • #31021
  • #31800
  • #31804
  • #31828
  • #31844
  • #31845
  • #31846
  • #31954
  • #32030
  • #32031
  • #32119
  • #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 stdlib labels Feb 14, 2021
    @mrahtz mrahtz mannequin added tests interpreter-core 3.11 and removed 3.10 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 and removed 3.10 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

    @JelleZijlstra JelleZijlstra commented Mar 8, 2022

    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

    @serhiy-storchaka serhiy-storchaka commented Mar 11, 2022

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

    @Fidget-Spinner
    Copy link
    Member

    @Fidget-Spinner Fidget-Spinner commented Mar 12, 2022

    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

    @JelleZijlstra JelleZijlstra commented Mar 18, 2022

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

    @mrahtz
    Copy link
    Mannequin Author

    @mrahtz 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? #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

    @JelleZijlstra JelleZijlstra commented Mar 25, 2022

    1. Finish writing docs (is updating library/typing.html sufficient? #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

    @JelleZijlstra JelleZijlstra commented Mar 26, 2022

    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 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

    @JelleZijlstra JelleZijlstra commented Apr 5, 2022

    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

    @gvanrossum gvanrossum commented Apr 11, 2022

    @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 mrahtz commented Apr 11, 2022

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

    @AlexWaygood AlexWaygood added expert-typing type-feature labels Apr 13, 2022
    @mrahtz
    Copy link
    Contributor

    @mrahtz mrahtz commented Apr 20, 2022

    Keeping track of things yet to do:

    • Decide on/implement type substitution behaviour (#91162)
    • Add tests for using * with things in typing.py (e.g. *Tuple[int]) now that the grammar PR has been merged
    • Implement support for/add tests for typing.get_args and typing.get_origin on unpacked types
    • Disallow Unpack[Tuple] (which I don't think even makes sense?)
    • Add some way of figure out whether a native tuple has been starred (#92059)
    • Finish making the runtime produce the results that the substitution tests https://github.com/python/cpython/blob/main/Lib/test/test_typing.py#L581 say it should
    • Add substitution test for tuple[*Ts, T][str, *tuple[int, ...]]
    • Fix TODOs in test_genericalias.py

    gvanrossum pushed a commit to gvanrossum/cpython that referenced this issue May 1, 2022
    gvanrossum pushed a commit to gvanrossum/cpython that referenced this issue May 1, 2022
    mrahtz added a commit to mrahtz/cpython that referenced this issue May 3, 2022
    Hilariously, before this PR, it turned out that `*tuple[int]` was equal to `tuple[int]`.
    
    Fixing it, I realised that pickling was also broken: it didn't preserve `gaobject.starred`.
    
    This PR fixes both :)
    mrahtz added a commit to mrahtz/cpython that referenced this issue May 3, 2022
    Hilariously, before this PR, it turned out that `*tuple[int]` was equal to `tuple[int]`.
    
    Fixing it, I realised that pickling was also broken: it didn't preserve `gaobject.starred`.
    
    This PR fixes both :)
    serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue May 5, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 expert-typing interpreter-core stdlib tests type-feature
    Projects
    None yet
    Development

    No branches or pull requests

    6 participants