Skip to content

MAINT: Move aliases for common scalar unions to numpy.typing#17429

Merged
mattip merged 4 commits intonumpy:masterfrom
BvB93:scalar-union2
Oct 7, 2020
Merged

MAINT: Move aliases for common scalar unions to numpy.typing#17429
mattip merged 4 commits intonumpy:masterfrom
BvB93:scalar-union2

Conversation

@BvB93
Copy link
Copy Markdown
Member

@BvB93 BvB93 commented Oct 3, 2020

Continuation of #17096: This PR adds aliases for common scalar union.

More specifically, it moves them from numpy to numpy.typing, as they had been
naturally popping up in the former as time progressed.

Examples

>>> from typing import Union
>>> import numpy as np

>>> _IntLike = Union[int, np.integer]
>>> _FloatLike = Union[_IntLike, float, np.floating]
...

@charris
Copy link
Copy Markdown
Member

charris commented Oct 5, 2020

Close/reopen.

@charris charris closed this Oct 5, 2020
@charris charris reopened this Oct 5, 2020
@BvB93
Copy link
Copy Markdown
Member Author

BvB93 commented Oct 5, 2020

The previous PyPy failure seems the be related to #17420.
Do you know by any chance if there is already a solution to aforementioned issue?

@charris
Copy link
Copy Markdown
Member

charris commented Oct 5, 2020

The Windows PyPy test is currently disabled in master, that's why the close/reopen.

@BvB93
Copy link
Copy Markdown
Member Author

BvB93 commented Oct 5, 2020

Github had a rather inventive way of "resolving" a merge conflict caused by #17372.
Fixed as of a86bc46.

@mattip
Copy link
Copy Markdown
Member

mattip commented Oct 7, 2020

@BvB93 is this good to go even without gh-17096? I ask since the initial comment mentions this is a continuation.

@BvB93
Copy link
Copy Markdown
Member Author

BvB93 commented Oct 7, 2020

@BvB93 is this good to go even without gh-17096? I ask since the initial comment mentions this is a continuation.

Yes, as the __init__.pyi file has changed quite a bit since gh-17096 it was easier (and cleaner) to start over again,
hence this new PR. The old PR can be ignored.

@mattip mattip merged commit fd01786 into numpy:master Oct 7, 2020
@mattip
Copy link
Copy Markdown
Member

mattip commented Oct 7, 2020

Thanks @BvB93

@BvB93 BvB93 deleted the scalar-union2 branch October 7, 2020 18:27
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