-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[PEP 695] Enable new type parameter syntax by default #17798
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JelleZijlstra
approved these changes
Sep 20, 2024
Diff from mypy_primer, showing the effect of this PR on open source code: artigraph (https://github.com/artigraph/artigraph)
+ src/arti/internal/utils.py:213: error: Incompatible default for argument "default" (default has type "None", argument has type "D") [assignment]
+ src/arti/internal/utils.py:213: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
+ src/arti/internal/utils.py:213: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
- src/arti/internal/utils.py:25: error: PEP 695 generics are not yet supported. Use --enable-incomplete-feature=NewGenericSyntax for experimental support [valid-type]
- src/arti/internal/utils.py:25: error: Name "Ret" is not defined [name-defined]
- src/arti/internal/utils.py:28: error: Unused "type: ignore[return-value]" comment [unused-ignore]
- src/arti/internal/utils.py:213: error: PEP 695 generics are not yet supported. Use --enable-incomplete-feature=NewGenericSyntax for experimental support [valid-type]
- src/arti/internal/utils.py:213: error: Name "V" is not defined [name-defined]
- src/arti/internal/utils.py:213: error: Name "D" is not defined [name-defined]
- src/arti/internal/utils.py:230: error: PEP 695 generics are not yet supported. Use --enable-incomplete-feature=NewGenericSyntax for experimental support [valid-type]
- src/arti/internal/utils.py:231: error: Name "K" is not defined [name-defined]
- src/arti/internal/utils.py:231: error: Name "V" is not defined [name-defined]
- src/arti/internal/utils.py:232: error: Name "V" is not defined [name-defined]
- src/arti/internal/utils.py:262: error: PEP 695 generics are not yet supported. Use --enable-incomplete-feature=NewGenericSyntax for experimental support [valid-type]
- src/arti/internal/utils.py:262: error: Name "K" is not defined [name-defined]
- src/arti/internal/utils.py:262: error: Name "V" is not defined [name-defined]
+ src/arti/internal/type_hints.py:119: error: Incompatible default for argument "default" (default has type "None", argument has type "D") [assignment]
+ src/arti/internal/type_hints.py:119: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
+ src/arti/internal/type_hints.py:119: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
+ src/arti/internal/type_hints.py:125: error: Incompatible default for argument "default" (default has type "None", argument has type "D") [assignment]
+ src/arti/internal/type_hints.py:125: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
+ src/arti/internal/type_hints.py:125: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
+ src/arti/internal/type_hints.py:130: error: Incompatible default for argument "default" (default has type "None", argument has type "D") [assignment]
+ src/arti/internal/type_hints.py:130: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
+ src/arti/internal/type_hints.py:130: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
+ src/arti/internal/type_hints.py:139: error: Argument 2 has incompatible type "type[T@get_item_from_annotated]"; expected "T@lenient_issubclass" [arg-type]
+ src/arti/internal/type_hints.py:177: error: Argument 2 to "_check_issubclass" has incompatible type "T"; expected "type" [arg-type]
- src/arti/internal/type_hints.py:118: error: PEP 695 generics are not yet supported. Use --enable-incomplete-feature=NewGenericSyntax for experimental support [valid-type]
- src/arti/internal/type_hints.py:119: error: Name "T" is not defined [name-defined]
- src/arti/internal/type_hints.py:119: error: Name "D" is not defined [name-defined]
- src/arti/internal/type_hints.py:120: error: Name "T" is not defined [name-defined]
- src/arti/internal/type_hints.py:120: error: Name "D" is not defined [name-defined]
- src/arti/internal/type_hints.py:124: error: PEP 695 generics are not yet supported. Use --enable-incomplete-feature=NewGenericSyntax for experimental support [valid-type]
- src/arti/internal/type_hints.py:125: error: Name "T" is not defined [name-defined]
- src/arti/internal/type_hints.py:125: error: Name "D" is not defined [name-defined]
- src/arti/internal/type_hints.py:126: error: Name "T" is not defined [name-defined]
- src/arti/internal/type_hints.py:126: error: Name "D" is not defined [name-defined]
- src/arti/internal/type_hints.py:129: error: PEP 695 generics are not yet supported. Use --enable-incomplete-feature=NewGenericSyntax for experimental support [valid-type]
- src/arti/internal/type_hints.py:130: error: Name "T" is not defined [name-defined]
- src/arti/internal/type_hints.py:130: error: Name "D" is not defined [name-defined]
- src/arti/internal/type_hints.py:131: error: Name "T" is not defined [name-defined]
- src/arti/internal/type_hints.py:131: error: Name "D" is not defined [name-defined]
- src/arti/internal/type_hints.py:166: error: PEP 695 generics are not yet supported. Use --enable-incomplete-feature=NewGenericSyntax for experimental support [valid-type]
- src/arti/internal/type_hints.py:166: error: Name "T" is not defined [name-defined]
- src/arti/internal/mappings.py:14: error: PEP 695 generics are not yet supported. Use --enable-incomplete-feature=NewGenericSyntax for experimental support [valid-type]
- src/arti/internal/mappings.py:14: error: Name "K" is not defined [name-defined]
- src/arti/internal/mappings.py:14: error: Name "V" is not defined [name-defined]
- src/arti/internal/mappings.py:15: error: Name "K" is not defined [name-defined]
- src/arti/internal/mappings.py:15: error: Name "V" is not defined [name-defined]
- src/arti/internal/mappings.py:16: error: Name "K" is not defined [name-defined]
- src/arti/internal/mappings.py:16: error: Name "V" is not defined [name-defined]
- src/arti/internal/mappings.py:21: error: Name "K" is not defined [name-defined]
- src/arti/internal/mappings.py:21: error: Name "V" is not defined [name-defined]
- src/arti/internal/mappings.py:27: error: Name "K" is not defined [name-defined]
- src/arti/internal/mappings.py:33: error: Name "K" is not defined [name-defined]
- src/arti/internal/mappings.py:33: error: Name "V" is not defined [name-defined]
- src/arti/internal/mappings.py:33: error: "frozendict" expects no type arguments, but 2 given [type-arg]
- src/arti/internal/mappings.py:47: error: Name "K" is not defined [name-defined]
- src/arti/internal/mappings.py:47: error: Name "V" is not defined [name-defined]
+ src/arti/internal/mappings.py:100: error: ClassVar cannot contain type variables [misc]
- src/arti/internal/mappings.py:64: error: PEP 695 type aliases are not yet supported. Use --enable-incomplete-feature=NewGenericSyntax for experimental support [valid-type]
- src/arti/internal/mappings.py:64: error: Name "K" is not defined [name-defined]
- src/arti/internal/mappings.py:64: error: Name "V" is not defined [name-defined]
- src/arti/internal/mappings.py:76: error: PEP 695 type aliases are not yet supported. Use --enable-incomplete-feature=NewGenericSyntax for experimental support [valid-type]
- src/arti/internal/mappings.py:76: error: Name "V" is not defined [name-defined]
- src/arti/internal/mappings.py:76: error: The type "type[TypedBox]" is not generic and not indexable [misc]
- src/arti/internal/mappings.py:76: error: Name "TypedBox" is used before definition [used-before-def]
- src/arti/internal/mappings.py:79: error: PEP 695 type aliases are not yet supported. Use --enable-incomplete-feature=NewGenericSyntax for experimental support [valid-type]
- src/arti/internal/mappings.py:79: error: Name "InputContainer" is used before definition [used-before-def]
- src/arti/internal/mappings.py:80: error: PEP 695 type aliases are not yet supported. Use --enable-incomplete-feature=NewGenericSyntax for experimental support [valid-type]
- src/arti/internal/mappings.py:80: error: Variable "arti.internal.mappings.InputElement" is not valid as a type [valid-type]
- src/arti/internal/mappings.py:80: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- src/arti/internal/mappings.py:94: error: PEP 695 generics are not yet supported. Use --enable-incomplete-feature=NewGenericSyntax for experimental support [valid-type]
- src/arti/internal/mappings.py:94: error: Variable "arti.internal.mappings.TypedNode" is not valid as a type [valid-type]
- src/arti/internal/mappings.py:94: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- src/arti/internal/mappings.py:94: error: Name "V" is not defined [name-defined]
- src/arti/internal/mappings.py:100: error: Name "V" is not defined [name-defined]
- src/arti/internal/mappings.py:103: error: Name "V" is not defined [name-defined]
- src/arti/internal/mappings.py:119: error: Variable "arti.internal.mappings.InputElement" is not valid as a type [valid-type]
- src/arti/internal/mappings.py:119: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- src/arti/internal/mappings.py:125: error: Variable "arti.internal.mappings.TypedNode" is not valid as a type [valid-type]
- src/arti/internal/mappings.py:125: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- src/arti/internal/mappings.py:125: error: Name "V" is not defined [name-defined]
- src/arti/internal/mappings.py:132: error: Name "V" is not defined [name-defined]
- src/arti/internal/mappings.py:145: error: Variable "arti.internal.mappings.TypedNode" is not valid as a type [valid-type]
- src/arti/internal/mappings.py:145: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
... (truncated 160 lines) ...
core (https://github.com/home-assistant/core)
+ Warning: NewGenericSyntax is already enabled by default
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think the PEP 695 syntax is supported well enough now to enable it by default.