Skip to content

Comments

Revert "Make IntoPyObject for Bound & Borrowed more generic"#5832

Merged
bschoenmaeckers merged 1 commit intomainfrom
revert-5831-independent-bound
Feb 19, 2026
Merged

Revert "Make IntoPyObject for Bound & Borrowed more generic"#5832
bschoenmaeckers merged 1 commit intomainfrom
revert-5831-independent-bound

Conversation

@Icxolu
Copy link
Member

@Icxolu Icxolu commented Feb 18, 2026

Reverts #5831 as it introduces unsoundness, see #5831 (comment)

@Icxolu Icxolu added the CI-skip-changelog Skip checking changelog entry label Feb 18, 2026
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error> {
Ok(self.as_unbound().bind_borrowed(py))
fn into_pyobject(self, _py: Python<'py>) -> Result<Self::Output, Self::Error> {
Ok(*self)
Copy link
Member

Choose a reason for hiding this comment

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

We could keep the other cases except this one I think.

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking about this further, and it occurred to me that one place where the lifetimes differ in the future might be subinterpreters.

Maybe given that were not entirely sure how that will play out, better to play cautious and not relax these implementations until a user asks for it?

@bschoenmaeckers bschoenmaeckers added this pull request to the merge queue Feb 19, 2026
Merged via the queue into main with commit 71fe3fb Feb 19, 2026
45 of 46 checks passed
@bschoenmaeckers bschoenmaeckers deleted the revert-5831-independent-bound branch February 19, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI-skip-changelog Skip checking changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants