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
New semantic analyzer: invalid type variable produces additional error #6957
[case testMoreInvalidTypevarArguments]
from typing import TypeVar
defer: Yes
S = TypeVar('S', covariant=True, contravariant=True) # E: TypeVar cannot be both covariant and contravariant
class Yes: ...
[builtins fixtures/bool.pyi]
because there is an additional (and somewhat confusing) error:
Cannot redefine 'S' as a type variable
See also #6300 and #6563 (ideally, the latter should also fix this issue).
Activity
ilevkivskyi commentedon Jun 27, 2019
This is quite annoying when testing (namely when running tests with an extra iteration), so raising priority to normal.
Complain abaout redefinition after only after we decided it is valid (#…