Skip to content

as_mapping never fails #3310

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 2 commits into from
Oct 15, 2021
Merged

Conversation

youknowone
Copy link
Member

@Snowapril could you review this PR? I think as_mapping never fails because it doesn't call any user function but just retuning function pointers.

Copy link
Contributor

@Snowapril Snowapril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! At initial thought, I was meaning that with PyResult I can represent whether implementing as_mapping or not. But slot itself is enough to that stuff. Looks good to me 😊

@DimitrisJim
Copy link
Member

But slot itself is enough to that stuff.

seems like it. Its closer to what CPython does too, they check type->tp_as_mapping while we do type.slots.as_mapping.load().

@DimitrisJim DimitrisJim merged commit dfd3d57 into RustPython:main Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants