Bug Report
In python/typeshed#13683 I'm trying to change a type var to the following:
_I = TypeVar("_I", int, bytes, float, bool, default=Any) # possibly memoryview types
Unfortunately, mypy complains: error: TypeVar default must be one of the constraint types [misc]. While this is of course generally sound advice, a default of Any should always be permissible, as this allows memoryview to stand for any possible memoryview type. Without it, users are forced to write memoryview[Any] in every instance, which is unreasonable.
Your Environment
- Mypy version used: 1.18.2
Bug Report
In python/typeshed#13683 I'm trying to change a type var to the following:
Unfortunately, mypy complains:
error: TypeVar default must be one of the constraint types [misc]. While this is of course generally sound advice, a default ofAnyshould always be permissible, as this allowsmemoryviewto stand for any possible memoryview type. Without it, users are forced to writememoryview[Any]in every instance, which is unreasonable.Your Environment