Skip to content

sequence: tidy up implementation#1826

Merged
davidhewitt merged 1 commit intoPyO3:mainfrom
davidhewitt:pysequence-tidy
Aug 24, 2021
Merged

sequence: tidy up implementation#1826
davidhewitt merged 1 commit intoPyO3:mainfrom
davidhewitt:pysequence-tidy

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.

2 participants