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

NonZero Int type support #2650

Closed
MiguelX413 opened this issue Sep 30, 2022 · 3 comments · Fixed by #2730
Closed

NonZero Int type support #2650

MiguelX413 opened this issue Sep 30, 2022 · 3 comments · Fixed by #2730

Comments

@MiguelX413
Copy link

MiguelX413 commented Sep 30, 2022

Implementing FromPyObject for NonZero int types.
I think it'd be a great minor feature, but far from necessary.

@davidhewitt
Copy link
Member

Agreed, I'd be very happy if someone was interested in adding this.

I've also wanted support for the ordered-float crate in the past for NotNan types, so would happily accept that as an optional feature like our other thirdparty conversion features.

@MiguelX413
Copy link
Author

Agreed, I'd be very happy if someone was interested in adding this.

I've also wanted support for the ordered-float crate in the past for NotNan types, so would happily accept that as an optional feature like our other thirdparty conversion features.

That sounds like a great idea! I'll see if I'm at a level good enough to add them myself.

@davidhewitt
Copy link
Member

Thanks for the interest! Have a look at the contents in https://github.com/PyO3/pyo3/tree/main/src/conversions.

I'd suggest putting these in conversions/std/num.rs and conversions/ordered_float.rs. I'd do them as separate PRs to keep reviews simpler and easier to track history.

Please ask if there are any parts which seem unclear which you'd like clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants