IntFloatTuple
from PEP 646 doesn't work as expected on Python<3.11
#103
Labels
IntFloatTuple
from PEP 646 doesn't work as expected on Python<3.11
#103
I was working on serialization / deserialization logic for the new PEP 646 in mashumaro, but unfortunately the following example from https://peps.python.org/pep-0646/#type-arguments-can-be-variadic doesn't work as expected on older python versions with typing-extensions 4.4.0:
The PEP said:
On python 3.11.0 it works seamlessly as expected:
On python 3.10.9 it produces error on
IntFloatTuple = IntTuple[float, Unpack[Ts2]]
:On python 3.9.16 it produces the same error on
IntFloatTuple = IntTuple[float, Unpack[Ts2]]
:On python 3.8.16 it produces wrong result:
On python 3.7.16 it produces the same wrong result:
I couldn't figure out how to get type arguments the same on all python versions, and so it stops me from full support for variadic generics. At the moment I have to skip some tests like this one on python<3.11.
P.S. This problem also affects
IntFloatsTuple = IntTuple[Unpack[Tuple[float, ...]]]
.The text was updated successfully, but these errors were encountered: