Skip to content

Commit

Permalink
Implemented PR suggestions by @hauntsaninja.
Browse files Browse the repository at this point in the history
  • Loading branch information
erictraut committed Jan 5, 2024
1 parent 5d52820 commit 728b24c
Show file tree
Hide file tree
Showing 17 changed files with 117 additions and 89 deletions.
1 change: 0 additions & 1 deletion conformance/results/mypy/generics_paramspec_basic.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ generics_paramspec_basic.py:27: error: Invalid location for Concatenate [valid-
generics_paramspec_basic.py:27: note: You can use Concatenate as the first argument to Callable
generics_paramspec_basic.py:31: error: Invalid location for ParamSpec "P" [misc]
generics_paramspec_basic.py:31: note: You can use ParamSpec as the first argument to Callable, e.g., 'Callable[P, int]'
generics_paramspec_basic.py:35: error: Name "func3" already defined on line 31 [no-redef]
generics_paramspec_basic.py:35: error: Invalid location for ParamSpec "P" [valid-type]
generics_paramspec_basic.py:35: note: You can use ParamSpec as the first argument to Callable, e.g., 'Callable[P, int]'
generics_paramspec_basic.py:39: error: Invalid location for ParamSpec "P" [valid-type]
Expand Down
15 changes: 8 additions & 7 deletions conformance/results/mypy/generics_syntax_declarations.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,22 @@ generics_syntax_declarations.py:19: error: PEP 695 generics are not yet supporte
generics_syntax_declarations.py:19: error: Free type variable expected in Generic[...] [misc]
generics_syntax_declarations.py:19: error: Name "T" is not defined [name-defined]
generics_syntax_declarations.py:23: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_declarations.py:23: error: Free type variable expected in Protocol[...] [misc]
generics_syntax_declarations.py:23: error: Name "S" is not defined [name-defined]
generics_syntax_declarations.py:23: error: Name "T" is not defined [name-defined]
generics_syntax_declarations.py:27: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_declarations.py:28: error: Name "T" is not defined [name-defined]
generics_syntax_declarations.py:33: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_declarations.py:27: error: Free type variable expected in Protocol[...] [misc]
generics_syntax_declarations.py:27: error: Name "S" is not defined [name-defined]
generics_syntax_declarations.py:27: error: Name "T" is not defined [name-defined]
generics_syntax_declarations.py:31: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_declarations.py:32: error: Name "T" is not defined [name-defined]
generics_syntax_declarations.py:37: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_declarations.py:41: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_declarations.py:42: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_declarations.py:45: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_declarations.py:46: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_declarations.py:50: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_declarations.py:54: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_declarations.py:58: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_declarations.py:62: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_declarations.py:69: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_declarations.py:66: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_declarations.py:73: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_declarations.py:77: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_declarations.py:81: error: PEP 695 generics are not yet supported [valid-type]
"""
97 changes: 53 additions & 44 deletions conformance/results/mypy/generics_syntax_infer_variance.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,51 +50,60 @@ generics_syntax_infer_variance.py:72: error: The type "type[ShouldBeCovariant5]"
generics_syntax_infer_variance.py:75: error: Free type variable expected in Generic[...] [misc]
generics_syntax_infer_variance.py:76: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:76: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:84: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:84: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:88: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg]
generics_syntax_infer_variance.py:88: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:89: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg]
generics_syntax_infer_variance.py:89: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:92: error: Free type variable expected in Generic[...] [misc]
generics_syntax_infer_variance.py:93: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:93: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:96: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:96: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:99: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:99: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:103: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg]
generics_syntax_infer_variance.py:103: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:104: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg]
generics_syntax_infer_variance.py:104: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:107: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:78: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:78: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:82: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]
generics_syntax_infer_variance.py:82: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:83: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]
generics_syntax_infer_variance.py:83: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:86: error: Free type variable expected in Generic[...] [misc]
generics_syntax_infer_variance.py:87: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:87: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:95: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:95: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:99: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg]
generics_syntax_infer_variance.py:99: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:100: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg]
generics_syntax_infer_variance.py:100: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:103: error: Free type variable expected in Generic[...] [misc]
generics_syntax_infer_variance.py:104: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:104: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:107: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:107: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:107: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:111: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg]
generics_syntax_infer_variance.py:111: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:112: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg]
generics_syntax_infer_variance.py:112: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:113: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg]
generics_syntax_infer_variance.py:113: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:114: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg]
generics_syntax_infer_variance.py:114: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:118: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_infer_variance.py:119: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:119: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:122: error: "ShouldBeInvariant4" expects no type arguments, but 1 given [type-arg]
generics_syntax_infer_variance.py:122: error: The type "type[ShouldBeInvariant4]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:125: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_infer_variance.py:126: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:126: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:130: error: "ShouldBeInvariant5" expects no type arguments, but 1 given [type-arg]
generics_syntax_infer_variance.py:130: error: The type "type[ShouldBeInvariant5]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:133: error: Free type variable expected in Generic[...] [misc]
generics_syntax_infer_variance.py:134: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:134: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:110: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:110: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:114: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg]
generics_syntax_infer_variance.py:114: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:115: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg]
generics_syntax_infer_variance.py:115: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:118: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:118: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:118: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:122: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg]
generics_syntax_infer_variance.py:122: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:123: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg]
generics_syntax_infer_variance.py:123: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:124: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg]
generics_syntax_infer_variance.py:124: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:125: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg]
generics_syntax_infer_variance.py:125: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:129: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_infer_variance.py:130: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:130: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:133: error: "ShouldBeInvariant4" expects no type arguments, but 1 given [type-arg]
generics_syntax_infer_variance.py:133: error: The type "type[ShouldBeInvariant4]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:136: error: PEP 695 generics are not yet supported [valid-type]
generics_syntax_infer_variance.py:137: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:137: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:141: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]
generics_syntax_infer_variance.py:141: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:142: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]
generics_syntax_infer_variance.py:142: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:141: error: "ShouldBeInvariant5" expects no type arguments, but 1 given [type-arg]
generics_syntax_infer_variance.py:141: error: The type "type[ShouldBeInvariant5]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:144: error: Free type variable expected in Generic[...] [misc]
generics_syntax_infer_variance.py:145: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:145: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:148: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:148: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:152: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]
generics_syntax_infer_variance.py:152: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc]
generics_syntax_infer_variance.py:153: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]
generics_syntax_infer_variance.py:153: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc]
"""
1 change: 1 addition & 0 deletions conformance/results/pyre/generics_paramspec_basic.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ generics_paramspec_basic.py:18:0 Incompatible variable type [9]: TA3 is declared
generics_paramspec_basic.py:18:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[object, None]`.
generics_paramspec_basic.py:27:13 Invalid type variable [34]: The type variable `P` isn't present in the function's parameters.
generics_paramspec_basic.py:27:13 Undefined or invalid type [11]: Annotation `Concatenate` is not defined as a type.
generics_paramspec_basic.py:31:13 Invalid type parameters [24]: Single type parameter `Variable[_T]` expected, but a callable parameters `generics_paramspec_basic.P` was given for generic type list.
"""
2 changes: 1 addition & 1 deletion conformance/results/pyre/generics_syntax_declarations.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ notes = """
Type parameter syntax not yet support.
"""
output = """
generics_syntax_declarations.py:13:13 Parsing failure [404]: invalid syntax
generics_syntax_declarations.py:13:17 Parsing failure [404]: invalid syntax
"""
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ notes = """
Type parameter syntax not yet support.
"""
output = """
generics_syntax_infer_variance.py:118:25 Parsing failure [404]: invalid syntax
generics_syntax_infer_variance.py:129:25 Parsing failure [404]: invalid syntax
"""
1 change: 0 additions & 1 deletion conformance/results/pyright/generics_paramspec_basic.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ generics_paramspec_basic.py:31:19 - error: Type "P@func3" cannot be assigned to
generics_paramspec_basic.py:35:35 - error: ParamSpec is not allowed in this context
generics_paramspec_basic.py:39:18 - error: ParamSpec is not allowed in this context
generics_paramspec_basic.py:39:31 - error: ParamSpec is not allowed in this context
generics_paramspec_basic.py:31:5 - error: Function declaration "func3" is obscured by a declaration of the same name (reportGeneralTypeIssues)
"""
16 changes: 8 additions & 8 deletions conformance/results/pyright/generics_syntax_declarations.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
conformant = "Pass"
output = """
generics_syntax_declarations.py:19:17 - error: "Generic" base class cannot be used with type parameter syntax (reportGeneralTypeIssues)
generics_syntax_declarations.py:23:20 - error: Type arguments are not allowed with Protocol class when using type parameter syntax (reportGeneralTypeIssues)
generics_syntax_declarations.py:30:11 - error: Cannot access member "is_integer" for type "str*"
generics_syntax_declarations.py:27:20 - error: Type arguments are not allowed with Protocol class when using type parameter syntax (reportGeneralTypeIssues)
generics_syntax_declarations.py:34:11 - error: Cannot access member "is_integer" for type "str*"
  Member "is_integer" is unknown (reportGeneralTypeIssues)
generics_syntax_declarations.py:42:21 - error: TypeVar constraint type cannot be generic
generics_syntax_declarations.py:46:17 - error: Expected type expression but received "list[Unknown]" (reportGeneralTypeIssues)
generics_syntax_declarations.py:58:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues)
generics_syntax_declarations.py:46:21 - error: TypeVar constraint type cannot be generic
generics_syntax_declarations.py:50:17 - error: Expected type expression but received "list[Unknown]" (reportGeneralTypeIssues)
generics_syntax_declarations.py:62:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues)
generics_syntax_declarations.py:69:17 - error: Expected type expression but received "tuple[type[bytes], type[str]]" (reportGeneralTypeIssues)
generics_syntax_declarations.py:73:18 - error: Expected type expression but received "Literal[3]" (reportGeneralTypeIssues)
generics_syntax_declarations.py:77:23 - error: "S" is not defined (reportUndefinedVariable)
generics_syntax_declarations.py:66:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues)
generics_syntax_declarations.py:73:17 - error: Expected type expression but received "tuple[type[bytes], type[str]]" (reportGeneralTypeIssues)
generics_syntax_declarations.py:77:18 - error: Expected type expression but received "Literal[3]" (reportGeneralTypeIssues)
generics_syntax_declarations.py:81:23 - error: "S" is not defined (reportUndefinedVariable)
"""
Loading

0 comments on commit 728b24c

Please sign in to comment.