Skip to content

fix #[derive(FromPyObject)] expansion with trait bounds#4645

Merged
davidhewitt merged 2 commits into
PyO3:mainfrom
Icxolu:fix/derive-frompyobject
Oct 25, 2024
Merged

fix #[derive(FromPyObject)] expansion with trait bounds#4645
davidhewitt merged 2 commits into
PyO3:mainfrom
Icxolu:fix/derive-frompyobject

Conversation

@Icxolu

@Icxolu Icxolu commented Oct 24, 2024

Copy link
Copy Markdown
Member

While writing the round-trip tests for #4495 I noticed that the FromPyObject derive macro does not handle bounds on generic parameters correctly. This fixes that with the same logic used in #4495.

@Icxolu Icxolu added the bugfix label Oct 24, 2024

@davidhewitt davidhewitt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! Surprising that users hadn't reported this case, but maybe it's rarer than I thought 👀

@davidhewitt davidhewitt added this pull request to the merge queue Oct 25, 2024
Merged via the queue into PyO3:main with commit b3bb667 Oct 25, 2024
@Icxolu

Icxolu commented Oct 25, 2024

Copy link
Copy Markdown
Member Author

Yeah, I was pretty surprised as well.

@Icxolu Icxolu deleted the fix/derive-frompyobject branch October 25, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants