Skip to content

add Borrowed::get to access class data#5849

Merged
Icxolu merged 2 commits intoPyO3:mainfrom
davidhewitt:borrowed-get
Mar 1, 2026
Merged

add Borrowed::get to access class data#5849
Icxolu merged 2 commits intoPyO3:mainfrom
davidhewitt:borrowed-get

Conversation

@davidhewitt
Copy link
Member

This PR adds Borrowed::get as a direct equivalent to Py::get and Bound::get.

This came up inside a custom FromPyObject implementation I'm writing for experiments relating to #1444, where I had a Borrowed input and I wanted to directly return Rust data derived from it

Copy link
Member

@Icxolu Icxolu left a comment

Choose a reason for hiding this comment

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

Looks like a reasonable addition to me.

@Icxolu Icxolu added this pull request to the merge queue Mar 1, 2026
Merged via the queue into PyO3:main with commit 12a51fa Mar 1, 2026
43 of 44 checks passed
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