-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for typing.Sequence[int] #27
Comments
Hey @anvdev, just letting you know that I've seen this and that I'm working on this. |
Hey @anvdev, The latest release, from typing import Sequence
from plum import dispatch
@dispatch
def el_to_str(x: Sequence[int]) -> Sequence[str]:
for i in range(len(x)):
x[i] = str(x[i])
return x >>> el_to_str([1, 2, 3])
['1', '2', '3']
>>> el_to_str([1.0, 2, 3])
For function "el_to_str", signature Signature(List[Union[builtins.int, builtins.float]]) could not be resolved. |
Thanks for your work. |
I must be missing something but the following raises an from collections.abc import Iterable
import plum
@plum.dispatch
def f(x: Iterable[int]): print("int!")
@plum.dispatch
def f(x: Iterable[str]): print("str!")
f(['first', 'second']) # AmbiguousLookupError: `f(['first', 'second'])` is ambiguous. If not, happy to contribute a fix. Is there no support for checking |
It's possibly a bug. Can you open a separate issue? |
Yes. |
For the code above I got
NotImplementedError: There is currently no support for "typing.Sequence[int]". Please open an issue at https://github.com/wesselb/plum/issues
The text was updated successfully, but these errors were encountered: