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

Support for PEP 646 #12280

Closed
erictraut opened this issue Mar 2, 2022 · 5 comments · Fixed by #16354
Closed

Support for PEP 646 #12280

erictraut opened this issue Mar 2, 2022 · 5 comments · Fixed by #16354
Labels
affects-typeshed Anything that blocks a typeshed change feature meta Issues tracking a broad area of work priority-0-high topic-pep-646 PEP 646 (TypeVarTuple, Unpack)

Comments

@erictraut
Copy link

PEP 646 has been accepted for inclusion in Python 3.11. Both pyre and pyright support it currently.

Third-party libraries and typeshed stubs will probably avoid using this functionality until mypy offers some level of support for it.

Perhaps as a first step, mypy could implement a minimal understanding of TypeVarTuple, Unpack, and the new grammar change for *? This would allow libraries to start using the new facilities without generating false positive errors in mypy. This is a similar approach to the one for PEP 612 (ParamSpec) and PEP 634 (structural pattern matching).

@tyralla
Copy link
Collaborator

tyralla commented Nov 18, 2022

@jhance: I thought about giving it a try but then realised you already did a lot of work (at least #13105, #13210, #13211, #13586, #13889) that has been merged. Is there still much to do where others could help?

@uriyyo
Copy link
Member

uriyyo commented Feb 6, 2023

Hi all,
Do we have a list of things left to implement to support PEP 646 fully?

@vavanade
Copy link

What's the current state on this?

@AlexWaygood
Copy link
Member

What's the current state on this?

See #16242 (comment)

@Lordfirespeed
Copy link

With #16242 merged, is this issue resolved?

JukkaL pushed a commit that referenced this issue Oct 30, 2023
Fixes #12280
Fixes #14697

In this PR:
* Enable `TypeVarTuple` and `Unpack` features.
* Delete the old blanket `--enable-incomplete-features` flag that was
deprecated a year ago.
* Switch couple corner cases to `PreciseTupleTypes` feature.
* Add the draft docs about the new feature.
* Handle a previously unhandled case where variadic tuple appears in
string formatting (discovered on mypy self-check, where
`PreciseTupleTypes` is already enabled).

---------

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
airallergy added a commit to airallergy/sober that referenced this issue Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-typeshed Anything that blocks a typeshed change feature meta Issues tracking a broad area of work priority-0-high topic-pep-646 PEP 646 (TypeVarTuple, Unpack)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants