evhub / coconut

Simple, elegant, Pythonic functional programming.
http://coconut-lang.org
Apache License 2.0
4.05k stars 120 forks source link

Fully support PEP 695 #757

Open evhub opened 1 year ago

evhub commented 1 year ago

We already mostly support PEP 695, except for:

evhub commented 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).

evhub commented 1 year ago

Tuple constraint syntax should work now, but I'll probably wait until 3.12 is released to get all the literal syntax working.

evhub commented 6 months ago

This is basically done except that it can't really be tested yet because mypy still doesn't support it.

evhub commented 5 months ago

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.

evhub commented 5 months ago

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.

evhub commented 1 week ago

We're waiting for infer_variance support here: https://github.com/python/mypy/issues/15238