-
-
Notifications
You must be signed in to change notification settings - Fork 32
Exporting type aliases for DtypeLike, ShapeLike and ArrayLike #13
Comments
Another option is for this repo to define a separate package called |
@JelleZijlstra That's a great alternative! Yes, we should definitely try the separate |
numpy-mypy has those: https://github.com/machinalis/mypy-data/tree/master/numpy-mypy |
This can be done without adding a separate package and without |
I think we resolved all the issues here in #66. |
These would indicate anything NumPy can coerce into the respective type:
DtypeLike
can be coerced into/withnp.dtype
ShapeLike
can be coerced intoTuple[int, ...]
ArrayLike
can be coerced intonp.ndarray
withnp.array
See #10 for (currently private) aliases
_DtypeLike
and_ShapeLike
.It would be nice to export these publicly for the benefit of downstream users.
The main complication is that this would likely also require adding these aliases to NumPy itself. Potentially, this could be unnecessary with
from __future__ import annotations
in Python 3.7 (PEP 564).The text was updated successfully, but these errors were encountered: