PEP 827: Type Manipulation

I don’t think this is an issue of this PEP, this is an issue of all type checkers.

When I get a “call doesn‘t match any of the overloaded signatures”, the error message is basically useless. I’d want to see a list of signatures that’s almost matched, with an explanation of which type doesn’t match why, e.g. when I pass a value that has a long union type to a parameter accepting a long union type, I’d like to see what union members caused the mismatch.

The functionality in this PEP is something I’ve been reaching for again and again, basically every single time I try to do something not completely trivial with Python’s type system – which means basically every single time I’ve been handling numeric code.

I feel like if you all tried to implement a single numpy-style function (with a dtype argument influencing the output type), you’d yearn for this PEP as much as I do.

2 Likes