Skip to content

Conversation

@Icxolu
Copy link
Contributor

@Icxolu Icxolu commented Oct 9, 2025

Follow up to #5488

This introduces the #[pyclass(from_py_object)] option for pyclass, to opt-in to extraction of pyclasses by value. This uses the same approach as the blanket impl that we are phasing out and thus requires the pyclass to be Clone.

Ref #5419

@Icxolu Icxolu force-pushed the pyclass-from-py-object branch from 1114d82 to 4dca94c Compare October 9, 2025 16:02
@Icxolu Icxolu force-pushed the pyclass-from-py-object branch from 4dca94c to 688f84d Compare October 9, 2025 17:00
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.

Thanks, this LGTM.

So the idea is to merge this flag into 0.27, and then in a follow up (probably in 0.28) start phasing in a requirement that one of these two flags is set?

@Icxolu
Copy link
Contributor Author

Icxolu commented Oct 10, 2025

So the idea is to merge this flag into 0.27, and then in a follow up (probably in 0.28) start phasing in a requirement that one of these two flags is set?

That is the idea, yes.

@Icxolu Icxolu added this pull request to the merge queue Oct 10, 2025
Merged via the queue into PyO3:main with commit 2490163 Oct 10, 2025
42 of 43 checks passed
@Icxolu Icxolu deleted the pyclass-from-py-object branch October 10, 2025 18:10
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