Skip to content

MAINT: Move the fromnumeric annotations to their own stub file#17309

Merged
charris merged 1 commit intonumpy:masterfrom
BvB93:numeric-move
Sep 16, 2020
Merged

MAINT: Move the fromnumeric annotations to their own stub file#17309
charris merged 1 commit intonumpy:masterfrom
BvB93:numeric-move

Conversation

@BvB93
Copy link
Copy Markdown
Member

@BvB93 BvB93 commented Sep 14, 2020

This pull request moves the fromnumeric annotations to their own dedicated stub file.

This should clean up the main __init__.pyi file a bit.

@BvB93
Copy link
Copy Markdown
Member Author

BvB93 commented Sep 14, 2020

CircleCI is failing but this is a known issue (#17301).

@person142
Copy link
Copy Markdown
Member

NumPy redefines the module that functions are reported to come from; does this cause any inconsistencies with that?

@BvB93
Copy link
Copy Markdown
Member Author

BvB93 commented Sep 14, 2020

NumPy redefines the module that functions are reported to come from; does this cause any inconsistencies with that?

For classes this would indeed be a bit of an issue, as it the likes of mypy use the classes' module for defining its name.
This behavior is unique to classes though, functions for example are only defined according to their signature, so this won't cause any issue here:

import numpy as np

array: np.ndarray

reveal_type(array)  # Revealed type is 'numpy.ndarray'
reveal_type(np.reshape)  # Revealed type is 'def (...)'

@charris charris merged commit f1f1436 into numpy:master Sep 16, 2020
@charris
Copy link
Copy Markdown
Member

charris commented Sep 16, 2020

Thanks @BvB93 .

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