Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mypy/semanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -4936,7 +4936,7 @@ def process_typevar_parameters(
return None
elif param_name == "bound":
if has_values:
self.fail("TypeVar cannot have both values and an upper bound", context)
self.fail("TypeVar cannot have both constraints and a bound", context)
return None
tv_arg = self.get_typevarlike_argument("TypeVar", param_name, param_value, context)
if tv_arg is None:
Expand Down
2 changes: 1 addition & 1 deletion test-data/unit/semanal-errors.test
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ k = TypeVar('k', contravariant=1) # E: TypeVar "contravariant" may only be a lit

[case testMoreInvalidTypevarArguments]
from typing import TypeVar
T = TypeVar('T', int, str, bound=bool) # E: TypeVar cannot have both values and an upper bound
T = TypeVar('T', int, str, bound=bool) # E: TypeVar cannot have both constraints and a bound
S = TypeVar('S', covariant=True, contravariant=True) \
# E: TypeVar cannot be both covariant and contravariant
[builtins fixtures/bool.pyi]
Expand Down
Loading