python-trio / trio-typing

Type hints for Trio and related projects
Other
27 stars 13 forks source link

Breaking change in `TypeVarType` causes an error during typecheck #84

Closed fjarri closed 11 months ago

fjarri commented 1 year ago

Mypy 1.4 includes PR https://github.com/python/mypy/pull/14872 that added a positional deault parameter to the mypy.types.TypeVarType constructor. plugin.py::takes_callable_and_args_callback() invokes it without that argument, causing mypy to crash.

This seems to be fixed by passing AnyType(TypeOfAny.from_omitted_generics) as an additional argument, but this will make trio-typing incompatible with mypy<1.4. Thoughts on how to proceed?