-
Notifications
You must be signed in to change notification settings - Fork 763
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
Expose binary operations (*, &, etc.) #3709
Comments
I would support having these, I've needed a couple of them in the past but just used the raw ffi instead of getting around to figuring out how to expose them properly 🙈 I think #3684 probably isn't blocking you. Maybe even just add the new methods only to the I haven't thought of a better way than to add methods for each operator. The usual problem with rust operators and traits is that we cannot express fallibility. I suppose for some of these we might be able to control the return value, does it make sense for |
These are available in the CPython API via
PyNumber_And
,PyNumber_Multiply
, etc.I'm happy to send PRs for these. Though a) it probably makes sense to do this after #3684, b) is there a better way to do this than dozens of new methods on
PyAny
? (https://docs.python.org/3/c-api/number.html)The text was updated successfully, but these errors were encountered: