Permitting more precise inferred types from ambiguous overloads
Discussions on Python.org
Permitting more precise inferred types from ambiguous overloads
The typing spec and conformance suite currently require that if overload resolution is ambiguous due to gradual argument types, the return type must be inferred as Any. This is motivated by maintaining graduality of inputs in the output. If an argument type of Any makes an overloaded call possibly resolve to either int or str, the return type should be usable as either int or str without error, otherwise we’ve effectively lost the graduality requested by the original Any. This motivation is wel...
The typing spec and conformance suite currently require that if overload resolution is ambiguous due to gradual argument types, the return type must be inferred as Any. This is…
0 comments
No comments yet.