Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/numpy-stubs/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,7 @@ class dtype(Generic[_ScalarT_co], metaclass=_DTypeMeta):
) -> dtype: ...

#
@classmethod
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

#
Expand Down Expand Up @@ -1754,6 +1755,7 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
) -> Self: ...

#
@classmethod
def __class_getitem__(cls, item: object, /) -> GenericAlias: ...

#
Expand Down Expand Up @@ -3504,6 +3506,10 @@ class generic(_ArrayOrScalarCommon, Generic[_ItemT_co]):

# NOTE: Naming it `bool_` results in less unreadable type-checker output
class bool_(generic[_BoolItemT_co], Generic[_BoolItemT_co]):
@classmethod
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

#
@overload
def __new__(cls, value: L[False, 0] | _Bool0 = ..., /) -> _Bool0: ...
@overload
Expand Down Expand Up @@ -3976,6 +3982,7 @@ class number(_CmpOpMixin[_nt.CoComplex_0d, _nt.CoComplex_1nd], generic[_NumberIt
def itemsize(self) -> int: ...

#
@classmethod
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

#
Expand Down Expand Up @@ -5036,6 +5043,10 @@ class void(flexible[bytes | tuple[Any, ...]]): # type: ignore[misc] # pyright:
class datetime64(
_RealMixin, _CmpOpMixin[datetime64, _ArrayLikeDT64_co], generic[_DT64ItemT_co], Generic[_DT64ItemT_co]
):
@classmethod
def __class_getitem__(cls, type_arg: type | object, /) -> GenericAlias: ...

#
@overload
def __new__(cls, /) -> datetime64[None]: ...
@overload
Expand Down Expand Up @@ -5193,6 +5204,7 @@ class timedelta64(
def nbytes(self) -> L[8]: ...

# inherited at runtime from `signedinteger`
@classmethod
def __class_getitem__(cls, type_arg: type | object, /) -> GenericAlias: ...

# NOTE: Only a limited number of units support conversion
Expand Down
23 changes: 0 additions & 23 deletions tool/allowlists/todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ numpy._core.asanyarray
numpy._core.asarray
numpy._core.ascontiguousarray
numpy._core.asfortranarray
numpy._core.bool.__class_getitem__
numpy._core.bool_.__class_getitem__
numpy._core.copyto
numpy._core.datetime64.__class_getitem__
numpy._core.defchararray.chararray.argsort
numpy._core.dtype.__new__
numpy._core.empty
Expand Down Expand Up @@ -91,10 +88,7 @@ numpy._core.numeric.asanyarray
numpy._core.numeric.asarray
numpy._core.numeric.ascontiguousarray
numpy._core.numeric.asfortranarray
numpy._core.numeric.bool.__class_getitem__
numpy._core.numeric.bool_.__class_getitem__
numpy._core.numeric.copyto
numpy._core.numeric.datetime64.__class_getitem__
numpy._core.numeric.dtype.__new__
numpy._core.numeric.empty
numpy._core.numeric.empty_like
Expand All @@ -111,9 +105,6 @@ numpy._core.numeric.ufunc.__signature__
numpy._core.numeric.void.__new__
numpy._core.numeric.where
numpy._core.numeric.zeros
numpy._core.numerictypes.bool.__class_getitem__
numpy._core.numerictypes.bool_.__class_getitem__
numpy._core.numerictypes.datetime64.__class_getitem__
numpy._core.numerictypes.object_.__new__
numpy._core.numerictypes.void.__new__
numpy._core.object_.__new__
Expand All @@ -132,8 +123,6 @@ numpy.asanyarray
numpy.asarray
numpy.ascontiguousarray
numpy.asfortranarray
numpy.bool.__class_getitem__
numpy.bool_.__class_getitem__
numpy.char.chararray.argsort
numpy.copyto
numpy.core._internal._ctypes.get_as_parameter
Expand Down Expand Up @@ -184,10 +173,7 @@ numpy.core.numeric.asanyarray
numpy.core.numeric.asarray
numpy.core.numeric.ascontiguousarray
numpy.core.numeric.asfortranarray
numpy.core.numeric.bool.__class_getitem__
numpy.core.numeric.bool_.__class_getitem__
numpy.core.numeric.copyto
numpy.core.numeric.datetime64.__class_getitem__
numpy.core.numeric.dtype.__new__
numpy.core.numeric.empty
numpy.core.numeric.empty_like
Expand All @@ -204,15 +190,11 @@ numpy.core.numeric.ufunc.__signature__
numpy.core.numeric.void.__new__
numpy.core.numeric.where
numpy.core.numeric.zeros
numpy.core.numerictypes.bool.__class_getitem__
numpy.core.numerictypes.bool_.__class_getitem__
numpy.core.numerictypes.datetime64.__class_getitem__
numpy.core.numerictypes.object_.__new__
numpy.core.numerictypes.void.__new__
numpy.core.umath.__all__
numpy.core.umath.matmul
numpy.corrcoef
numpy.datetime64.__class_getitem__
numpy.dtype.__new__
numpy.empty
numpy.empty_like
Expand Down Expand Up @@ -248,7 +230,6 @@ numpy.ma.asanyarray
numpy.ma.atleast_1d
numpy.ma.atleast_2d
numpy.ma.atleast_3d
numpy.ma.bool_.__class_getitem__
numpy.ma.clip
numpy.ma.column_stack
numpy.ma.compress
Expand All @@ -263,7 +244,6 @@ numpy.ma.core.arange
numpy.ma.core.argmax
numpy.ma.core.argmin
numpy.ma.core.asanyarray
numpy.ma.core.bool_.__class_getitem__
numpy.ma.core.clip
numpy.ma.core.compress
numpy.ma.core.copy
Expand Down Expand Up @@ -356,11 +336,8 @@ numpy.matlib.asanyarray
numpy.matlib.asarray
numpy.matlib.ascontiguousarray
numpy.matlib.asfortranarray
numpy.matlib.bool.__class_getitem__
numpy.matlib.bool_.__class_getitem__
numpy.matlib.copyto
numpy.matlib.corrcoef
numpy.matlib.datetime64.__class_getitem__
numpy.matlib.dtype.__new__
numpy.matlib.empty_like
numpy.matlib.finfo.smallest_normal
Expand Down