diff options
-rw-r--r-- | numpy/typing/__init__.py | 2 | ||||
-rw-r--r-- | numpy/typing/_scalars.py | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/numpy/typing/__init__.py b/numpy/typing/__init__.py index cbde75462..d8186a631 100644 --- a/numpy/typing/__init__.py +++ b/numpy/typing/__init__.py @@ -175,9 +175,11 @@ del TYPE_CHECKING, final from ._scalars import ( _CharLike, _BoolLike, + _UIntLike, _IntLike, _FloatLike, _ComplexLike, + _TD64Like, _NumberLike, _ScalarLike, _VoidLike, diff --git a/numpy/typing/_scalars.py b/numpy/typing/_scalars.py index d1a801cc2..90b2eff7b 100644 --- a/numpy/typing/_scalars.py +++ b/numpy/typing/_scalars.py @@ -10,11 +10,13 @@ _CharLike = Union[str, bytes] # The 6 `<X>Like` type-aliases below represent all scalars that can be # coerced into `<X>` (with the casting rule `same_kind`) _BoolLike = Union[bool, np.bool_] +_UIntLike = Union[_BoolLike, np.unsignedinteger] _IntLike = Union[_BoolLike, int, np.integer] _FloatLike = Union[_IntLike, float, np.floating] _ComplexLike = Union[_FloatLike, complex, np.complexfloating] -_NumberLike = Union[int, float, complex, np.number, np.bool_] +_TD64Like = Union[_IntLike, np.timedelta64] +_NumberLike = Union[int, float, complex, np.number, np.bool_] _ScalarLike = Union[ int, float, |