Skip to content

Commit

Permalink
🚨 intentionally ignore some pyright errors in numpy.dtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenham committed Feb 5, 2025
1 parent 2c4d38d commit 248de57
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/numpy-stubs/dtypes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ __all__ = [
_SCT_co = TypeVar("_SCT_co", bound=np.generic, covariant=True)

@type_check_only
class _SimpleDType(np.dtype[_SCT_co], Generic[_SCT_co]): # type: ignore[misc]
class _SimpleDType(np.dtype[_SCT_co], Generic[_SCT_co]): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]
names: None # pyright: ignore[reportIncompatibleVariableOverride]
def __new__(cls, /) -> Self: ...
def __getitem__(self, key: Any, /) -> NoReturn: ...
Expand Down Expand Up @@ -454,7 +454,7 @@ class VoidDType( # type: ignore[misc]
_TypeCodes[L["V"], L["V"], L[20]],
_NoOrder,
_NBit[L[1], _ItemSize_co],
np.dtype[np.void],
np.dtype[np.void], # pyright: ignore[reportGeneralTypeIssues]
Generic[_ItemSize_co],
):
# NOTE: `VoidDType(...)` raises a `TypeError` at the moment
Expand Down Expand Up @@ -613,8 +613,9 @@ class StringDType( # type: ignore[misc]
_TypeCodes[L["T"], L["T"], L[2056]],
_NativeOrder,
_NBit[L[8], L[16]],
# TODO: Replace the (invalid) `str` with the scalar type, once implemented
np.dtype[str], # type: ignore[type-var]
# TODO(jorenham): change once we have a string scalar type:
# https://github.com/numpy/numpy/pull/28196
np.dtype[str], # type: ignore[type-var] # pyright: ignore[reportGeneralTypeIssues,reportInvalidTypeArguments]
):
def __new__(cls, /) -> StringDType: ...
def __getitem__(self, key: Any, /) -> NoReturn: ...
Expand Down

0 comments on commit 248de57

Please sign in to comment.