fix: use "constraints and a bound" in TypeVar error message by nuglifeleoji · Pull Request #21126 · python/mypy

Fixes #20973.

PEP 484 uses constraints for the positional type arguments of TypeVar
(e.g. TypeVar("T", int, str)) and bound for the bound= keyword.
The existing error message used neither term correctly:

error: TypeVar cannot have both values and an upper bound

Updated to the standard PEP 484 terminology:

error: TypeVar cannot have both constraints and a bound

Changed mypy/semanal.py and the matching test fixture in
test-data/unit/semanal-errors.test.

Made with Cursor