You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d06c5dd
Browse filesBrowse the repository at this point in the historyBrowse files
conformance: remove questionable generic syntax test (#2368)
We noticed this test from a ty change that (correctly) disallows
passing `Foo[T]` where `type[Foo[T]]` is expected: `Foo[T]` is a
`GenericAlias`, not a type. But when I looked at the test, I noticed
it doesn't really make sense to use a generic here at all. `__init_subclass__`
is evaluated at the class level and can't possibly be generic. Probably
TypeVars should be disallowed here for the same reason they're disallowed
in ClassVars. But adding that to the spec or type checkers seems more
trouble than it's worth; for now let's just remove the dubious test.
Copy file name to clipboardExpand all lines: conformance/results/pycroscope/generics_syntax_scoping.toml
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,10 @@ errors_diff = """
4
4
output = """
5
5
./generics_syntax_scoping.py:14:19: TypeVar bound cannot be parameterized by type variables [invalid_annotation]
6
6
./generics_syntax_scoping.py:18:13: Type parameter bound cannot reference a later type parameter [invalid_type_parameter]
7
-
./generics_syntax_scoping.py:35:6: Undefined name: T [undefined_name]
8
-
./generics_syntax_scoping.py:44:12: Incompatible argument type for x: expected type[./generics_syntax_scoping.py.Foo[~T@./generics_syntax_scoping.py.decorator1.<locals>.decorator1]] but got types.GenericAlias (partial from <class 'Foo'>[Any[error]]) [incompatible_argument]
9
-
./generics_syntax_scoping.py:44:16: Undefined name: T [undefined_name]
10
-
./generics_syntax_scoping.py:92:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter]
11
-
./generics_syntax_scoping.py:95:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter]
12
-
./generics_syntax_scoping.py:98:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter]
7
+
./generics_syntax_scoping.py:26:6: Undefined name: T [undefined_name]
8
+
./generics_syntax_scoping.py:35:12: Incompatible argument type for x: expected type[./generics_syntax_scoping.py.Foo[~T@./generics_syntax_scoping.py.decorator1.<locals>.decorator1]] but got types.GenericAlias (partial from <class 'Foo'>[Any[error]]) [incompatible_argument]
9
+
./generics_syntax_scoping.py:35:16: Undefined name: T [undefined_name]
10
+
./generics_syntax_scoping.py:83:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter]
11
+
./generics_syntax_scoping.py:86:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter]
12
+
./generics_syntax_scoping.py:89:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter]
0 commit comments