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

sequence: tidy up implementation #1826

Merged
merged 1 commit into from Aug 24, 2021
Merged

Conversation

davidhewitt
Copy link
Member

Just noticed this while reviewing #1803

Copy link
Member

@birkenfeld birkenfeld left a comment

Choose a reason for hiding this comment

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

BTW, when I looked at the code earlier I got a bit worried about returning &PySequence here: there is no obligation for the functions on the (C)Python side to return something usable as a sequence.

But since PySequence is just an abstract API, not a concrete object type, there is no unsoundness, and it makes sense to keep the convenience on the Rust side.

@davidhewitt
Copy link
Member Author

👍 agreed, as I've understood it, calling the pysequence APIs with an incompatible object will just raise an error.

@davidhewitt davidhewitt merged commit 688823f into PyO3:main Aug 24, 2021
@davidhewitt davidhewitt deleted the pysequence-tidy branch August 24, 2021 08:14
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.

None yet

2 participants