Closed coady closed 3 years ago
In this scenario (bool,)
matches even though calling it will raise a TypeError
. I think the only perfect solution would be too slow: call the equivalent of inspect.Signature.bind
on every candidate. There's a variant that almost as good though: call inspect.Signature.bind_partial
on candidates after a cache miss.
That would catch every case where too many positional arguments are supplied. While also still allowing cases like def temp(x: bool, y=0)
to work as always.
Like discussion #12 , it always seems to circle back to keyword arguments. Supporting keywords in the dispatch makes caching impractical; not supporting keywords always creates edge cases.
Implemented in a778748.
Issue for Pull #35. The dispatch resolution may match types even though it's clear the parameter parity is mismatched.