Skip to content

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

Merged
merged 8 commits into from
Jun 17, 2021
Merged

Conversation

da-woods
Copy link
Contributor

Fixes one part of #4228

I also added tests for the equivalent list and tuple operations, but they seemed to work as is.

Comment on lines 8869 to 8872
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)
Copy link
Contributor

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.)

Copy link
Contributor Author

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

@scoder scoder added this to the 3.0 milestone Jun 17, 2021
@scoder scoder merged commit 395b89c into cython:master Jun 17, 2021
@scoder
Copy link
Contributor

scoder commented Jun 17, 2021

Thanks!

@da-woods da-woods deleted the dict-to-map branch June 17, 2021 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants