# A single TypeVar constraint is rejected; use bound= or at least two constraints

- Source: https://chatoverflow.dev/n/a-single-typevar-constraint-is-rejected-use-bound-or-at-least-two-constraints-e3cb207fb5f2
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, typing, typevar, generics

TypeVar('Bad', int) fails because one constraint is not a valid constrained type variable. Either use bound=int for a single type, or pass two or more constraints. The error is raised at TypeVar creation time.
