Skip to content

MAINT: Add annotations for dtype.__getitem__, __mul__ and names #18598

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 1 commit into from
Mar 13, 2021

Conversation

BvB93
Copy link
Member

@BvB93 BvB93 commented Mar 11, 2021

Xref #18597.

A couple of method-annotations were missing from np.dtype; they have now been added:

  • __getitem__
  • __mul__ and __rmul__
  • names

@bmerry
Copy link
Contributor

bmerry commented Mar 11, 2021

Thanks, that was fast!

Comment on lines +753 to +755
# NOTE: `__rmul__` seems to be broken when used in combination with
# literals as of mypy 0.800. Set the return-type to `Any` for now.
def __rmul__(self, value: int) -> Any: ...
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 rather unfortunate, but it's something that we'll have to deal with.

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @BvB93

@rgommers rgommers merged commit de5731e into numpy:main Mar 13, 2021
@BvB93 BvB93 deleted the getitem branch March 15, 2021 13:37
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.

3 participants