Closed adam-urbanczyk closed 3 years ago
BTW: If you are OK with solving this (by e.g. adding another key to the dispatch dict; first come first served in the case of ambiguities) it'd be great to have it before #50 ...
This has come up before: #31.
The problem is handling ambiguity. I think that []
should match List[bool]
over List[int]
, but also suspect that that would be surprising and perceived as a bug to users.
Thanks for the reference. I'm not sure what you mean with matching bool over int. I was just hoping for a solution that matches any list that was specified in the signature. In the case of ambiguities matching first (or last) defined would be perfectly fine.
Otherwise, do you have any suggestions regarding working around this issue?
Ok, I'm willing to try it, as long as it's marked as provisional. Maybe there won't be any issues filed over ambiguous dispatch. Also, []
can be used be as a literal now.
Great, current solution works perfectly for my use case.
The following does result in a DispatchError:
Is it intended?