-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fixed conversion from DictNode to map #4231
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
Conversation
Cython/Compiler/ExprNodes.py
Outdated
elif dst_type.is_cpp_class and dst_type.can_coerce_from_pyobject(env): | ||
# not guaranteed that we can coerce from this particular PyObject, but worth a try | ||
# Note that other places seem to try calling create_from_py_utility_code instead | ||
return CoerceFromPyTypeNode(dst_type, self, env) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we just call ExprNode.coerce_to()
as a general fallback?
(BTW, can_coerce_from_pyobject()
was just added later than create_from_py_utility_code()
to avoid always doing the actual work, if all we need is know if it can be done.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to work. It's possible there might be some tests looking for the specific error message that need accounting for... we'll see
Co-authored-by: scoder <stefan_ml@behnel.de>
Thanks! |
Fixes one part of #4228
I also added tests for the equivalent list and tuple operations, but they seemed to work as is.