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 ToPyObject impl for HashSet accept non-default hashers. #1702

Merged

Conversation

ohadravid
Copy link
Contributor

I had some code like

let s = HashSet<u32>::new();
s.to_object(py)

I switched to HashSet<_, FxBuildHasher>, and it stopped working.
So this PR changes the ToPyObject impl for HashSet to accept non-default hashers.

I didn't add a test since I saw that the other converter impls (for example HashMap, into_py) don't have tests for non-default BuildHashers, but let me know if you want me to add them anyway :)

@ohadravid ohadravid force-pushed the to-python-set-non-default-hashbuilder branch from 02e9e75 to 43fca5d Compare June 27, 2021 12:19
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 for the fix! As this is just adding a generic parameter I'm fine to skip adding a test.

@davidhewitt davidhewitt merged commit 0215054 into PyO3:main Jun 27, 2021
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.

None yet

2 participants