Skip to content
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

pyclass: mapping flag #2265

Merged
merged 2 commits into from
Apr 4, 2022
Merged

pyclass: mapping flag #2265

merged 2 commits into from
Apr 4, 2022

Conversation

davidhewitt
Copy link
Member

This adds a #[pyclass(mapping)] option, to disable the sequence-slot-flling behaviour introduced in PyO3 0.16 (#2065).

This is helpful in cases where you want to implement a mapping, because having the sequence slots filled in that case is simply incorrect.

I didn't add #[pyclass(sequence)] because the it wouldn't do anything - to implement sequence slicing the mapping slots have to be used anyway.

@davidhewitt davidhewitt mentioned this pull request Apr 2, 2022
Copy link
Member

@messense messense left a comment

Choose a reason for hiding this comment

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

👍

@davidhewitt davidhewitt merged commit 981eb2d into PyO3:main Apr 4, 2022
@davidhewitt davidhewitt deleted the pyclass-mapping branch April 4, 2022 18:54
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.

4 participants