-
Notifications
You must be signed in to change notification settings - Fork 72
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
Throwing one exception in dicttoolz.itemmap() results in TypeError in cytoolz but NOT in toolz #162
Comments
Huh, interesting. Thanks for the report, because we do want |
I can share the Python code. It's in the repository https://github.com/Reveal-Energy-Services/orchid-python-api; however, this code wraps a .NET API that is not generally available. The test code module is in Strangely, when run this morning, the error reported by PyCharm is that cytools.functional.curry has no attribute items:
If available, I would be willing to get on a Zoom or Teams call with someone to walk through my issue this afternoon or evening (CDT -06:00). I'll try to look into it in more detail this afternoon my time to try to identify the issue more specifically. |
I changed my unit test code to the following:
When I run this test, it fails with an
The error appears to occur because a curried function (perhaps |
I've attached a small zipped file that demonstrates the issue: Hopefully you can confirm the issue with this file and address it appropriately. Thanks! |
Aha. This is interesting--thanks again @mrwizard82d1. >>> import cytoolz
>>> import inspect
>>> sig = inspect.signature(cytoolz.itemmap)
>>> sig
<Signature (func, d, factory)>
>>> sig.parameters['factory'].kind
<_ParameterKind.POSITIONAL_OR_KEYWORD: 1>
>>> sig.parameters['factory'].default
<class 'inspect._empty'> Incorrect signature introspection will cause In old versions of Python/Cython, So, we can further investigate why We could also choose to use our signature registry over |
Oh, this is a duplicate of #135. Perhaps supposedly fixed in Cython? cython/cython#1864 |
Thanks, @eriknw, for looking into this issue! |
I have a deadline tomorrow and so have not been able to identify a small code snippet exhibiting the behavior.
I am running a unit test in my package. This unit test expects a custom exception to be thrown.
Using toolz, this unit test passes. I have replaced all statements
import toolz.curried as toolz
withimport cytoolz.curried as toolz
in my code base. After this change, a single unit test fails with the error:The text was updated successfully, but these errors were encountered: