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

Enable Unpack/TypeVarTuple support #16354

Merged
merged 4 commits into from Oct 30, 2023
Merged

Conversation

ilevkivskyi
Copy link
Member

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

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, a few wording suggestions

docs/source/command_line.rst Outdated Show resolved Hide resolved
docs/source/command_line.rst Outdated Show resolved Hide resolved
docs/source/command_line.rst Outdated Show resolved Hide resolved
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

pycryptodome (https://github.com/Legrandin/pycryptodome)
- lib/Crypto/Protocol/DH.pyi:15: error: "Unpack" support is experimental, use --enable-incomplete-feature=Unpack to enable  [misc]

pydantic (https://github.com/samuelcolvin/pydantic)
- pydantic/fields.py:175: error: "Unpack" support is experimental, use --enable-incomplete-feature=Unpack to enable  [misc]
- pydantic/fields.py:182: error: Unused "type: ignore" comment  [unused-ignore]
- pydantic/fields.py:214: error: Unused "type: ignore" comment  [unused-ignore]
- pydantic/fields.py:218: error: "Unpack" support is experimental, use --enable-incomplete-feature=Unpack to enable  [misc]
- pydantic/fields.py:705: error: "Unpack" support is experimental, use --enable-incomplete-feature=Unpack to enable  [misc]
- pydantic/fields.py:762: error: Unused "type: ignore" comment  [unused-ignore]
- pydantic/fields.py:766: error: Unused "type: ignore" comment  [unused-ignore]
- pydantic/fields.py:772: error: Unused "type: ignore" comment  [unused-ignore]
- pydantic/fields.py:778: error: Unused "type: ignore" comment  [unused-ignore]
- pydantic/fields.py:788: error: Unused "type: ignore" comment  [unused-ignore]
- pydantic/fields.py:794: error: Unused "type: ignore" comment  [unused-ignore]
- pydantic/fields.py:821: error: Unused "type: ignore" comment  [unused-ignore]
- pydantic/main.py:127: error: Unused "type: ignore" comment  [unused-ignore]
- pydantic/main.py:128: error: Unused "type: ignore" comment  [unused-ignore]
- pydantic/main.py:129: error: Unused "type: ignore" comment  [unused-ignore]
- pydantic/main.py:883: error: "Unpack" support is experimental, use --enable-incomplete-feature=Unpack to enable  [misc]

discord.py (https://github.com/Rapptz/discord.py): typechecking got 1.08x slower (146.0s -> 157.6s)
(Performance measurements are based on a single noisy sample)

@JukkaL JukkaL merged commit ad0e183 into python:master Oct 30, 2023
19 checks passed
@ilevkivskyi ilevkivskyi deleted the enable-tvt branch October 30, 2023 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable PEP 692 Support Support for PEP 646
4 participants