Skip to content

Commit b7bd3a3

Browse files
authored
👷 enable PYI046 in ruff (#450)
1 parent 168a3fc commit b7bd3a3

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

‎src/numpy-stubs/.ruff.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ extend-ignore = [
66
"A", # flake8-builtins
77
"S404", # flake8-bandit: suspicious-subprocess-import
88
"PYI042", # flake8-pyi: snake-case-type-alias # TODO
9-
"PYI046", # flake8-pyi: unused-private-protocol # TODO
109
"PYI047", # flake8-pyi: unused-private-type-alias # TODO
1110
"PYI064", # flake8-pyi: redundant-final-literal
1211
"SLF001", # flake8-self: private-member-access

‎src/numpy-stubs/_core/_multiarray_umath.pyi

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ from typing import (
2020
overload,
2121
type_check_only,
2222
)
23-
from typing_extensions import Buffer, CapsuleType, Self, TypeAliasType, TypeVar, Unpack, deprecated, override
23+
from typing_extensions import Buffer, CapsuleType, Self, TypeAliasType, TypeVar, Unpack, deprecated
2424

2525
import numpy as np
2626
import numpy.typing as npt
@@ -91,7 +91,6 @@ from .umath import (
9191

9292
###
9393

94-
_T = TypeVar("_T")
9594
_T_contra = TypeVar("_T_contra", default=None, contravariant=True)
9695

9796
_ShapeT = TypeVar("_ShapeT", bound=tuple[int, ...])
@@ -224,16 +223,6 @@ class _CanWriteErr(Protocol):
224223
class _HasDoc(Protocol):
225224
__doc__: str | None
226225

227-
@type_check_only
228-
@final
229-
class _HasClass(Protocol[_T]):
230-
@property
231-
@override
232-
def __class__(self, /) -> type[_T]: ... # pyright: ignore[reportIncompatibleMethodOverride]
233-
@__class__.setter
234-
@override
235-
def __class__(self, t: type[_T], /) -> None: ...
236-
237226
###
238227

239228
@type_check_only

‎src/numpy-stubs/_typing/_array_like.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class _SupportsArray(Protocol[_DType_co]):
2626
def __array__(self, /) -> np.ndarray[Any, _DType_co]: ...
2727

2828
@runtime_checkable
29-
class _SupportsArrayFunc(Protocol):
29+
class _SupportsArrayFunc(Protocol): # noqa: PYI046
3030
def __array_function__(
3131
self,
3232
func: Callable[..., Any],

0 commit comments

Comments
 (0)