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

Make arrays backed by owned data writeable. #235

Merged
merged 1 commit into from Jan 3, 2022
Merged

Make arrays backed by owned data writeable. #235

merged 1 commit into from Jan 3, 2022

Conversation

adamreichold
Copy link
Member

Fixes #185

@davidhewitt
Copy link
Member

davidhewitt commented Jan 3, 2022

Seems reasonable to me, thanks! Do you think there's ever a case where users would want this to be readonly? (i.e. should the function take an argument to choose writable or not?)

Also as a user-facing change, I think this wants to have a CHANGELOG entry?

@adamreichold
Copy link
Member Author

Do you think there's ever a case where users would want this to be readonly?

For the Python side, the flags can also be modified to seal the array afterwards. On the Rust side, I would rather expect us to provide an owning variant of PyReadonlyArray instead of flags for the conversion method, but I would avoid adding that API until it is actually requested.

@adamreichold
Copy link
Member Author

Also as a user-facing change, I think this wants to have a CHANGELOG entry?

Fixed.

Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Perfect, agreed and thanks!

@davidhewitt davidhewitt merged commit 480bf55 into PyO3:main Jan 3, 2022
@adamreichold adamreichold deleted the owned-data-writeable branch January 3, 2022 12:37
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.

Return mutable array from rust to python
2 participants