Open evhub opened 1 year ago
I don't think lazy evaluation of type
statements is something we can do while also keeping type checkers happy, so probably we'll just stick with the existing string-based solution (though since we'll use the literal syntax on 3.12, we'll still get the lazy evaluation there).
Tuple constraint syntax should work now, but I'll probably wait until 3.12 is released to get all the literal syntax working.
This is basically done except that it can't really be tested yet because mypy
still doesn't support it.
Actually, we need to also emit literal syntax for def f[T](...): ...
as well, since if we don't it messes up typing.overload
declarations by inserting the typevar declarations in-between.
I think the only thing remaining now is we're just waiting on mypy
to support this so we can test it on 3.12.
We're waiting for infer_variance
support here: https://github.com/python/mypy/issues/15238
We already mostly support PEP 695, except for:
type
statements