8000 ENH: Add annotations for bitwise operations by BvB93 · Pull Request #17465 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Add annotations for bitwise operations #17465

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

Merged
merged 3 commits into from
Oct 9, 2020
Merged

Conversation

BvB93
Copy link
Member
@BvB93 BvB93 commented Oct 6, 2020

This pull requests adds annotations for ndarray and generic bitwise operations:

  • __invert__
  • __lshift__
  • __rshift__
  • __and__
  • __or__
  • __xor__

Unfortunately the likes of `self: uint64` don't work with protocols.

Revisit this once we add proper support for numerical precision.
Copy link
Member
@mattip mattip left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +116 to +118
# TODO: The likes of `uint64 | np.signedinteger` will fail as there
# is no signed integer type large enough to hold a `uint64`
# See https://github.com/numpy/numpy/issues/2524
Copy link
Member

Choose a reason for hiding this comment

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

This comment seems misplaced to me, it applies to the second overload only.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is correct. Inserting a comment between two overloads looks visually rather bad though, hence why it is on top.

@charris charris merged commit 0cefa59 into numpy:master Oct 9, 2020
@BvB93 BvB93 deleted the bitwise-ops branch October 14, 2020 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0