🌐 AI搜索 & 代理 主页
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
2 changes: 2 additions & 0 deletions numpy/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5736,6 +5736,8 @@ pow = power
true_divide = divide

class errstate:
__slots__ = "_all", "_call", "_divide", "_invalid", "_over", "_token", "_under"

def __init__(
self,
*,
Expand Down
2 changes: 2 additions & 0 deletions numpy/exceptions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class TooHardError(RuntimeError): ...
class DTypePromotionError(TypeError): ...

class AxisError(ValueError, IndexError):
__slots__ = "_msg", "axis", "ndim"

axis: int | None
ndim: int | None
@overload
Expand Down
12 changes: 12 additions & 0 deletions numpy/lib/_index_tricks_impl.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ class ndindex:
def ndincr(self, /) -> None: ...

class nd_grid(Generic[_BoolT_co]):
__slots__ = ("sparse",)

sparse: _BoolT_co
def __init__(self, sparse: _BoolT_co = ...) -> None: ...
@overload
Expand All @@ -115,10 +117,14 @@ class nd_grid(Generic[_BoolT_co]):

@final
class MGridClass(nd_grid[L[False]]):
__slots__ = ()

def __init__(self) -> None: ...

@final
class OGridClass(nd_grid[L[True]]):
__slots__ = ()

def __init__(self) -> None: ...

class AxisConcatenator(Generic[_AxisT_co, _MatrixT_co, _NDMinT_co, _Trans1DT_co]):
Expand Down Expand Up @@ -155,13 +161,19 @@ class AxisConcatenator(Generic[_AxisT_co, _MatrixT_co, _NDMinT_co, _Trans1DT_co]

@final
class RClass(AxisConcatenator[L[0], L[False], L[1], L[-1]]):
__slots__ = ()

def __init__(self, /) -> None: ...

@final
class CClass(AxisConcatenator[L[-1], L[False], L[2], L[0]]):
__slots__ = ()

def __init__(self, /) -> None: ...

class IndexExpression(Generic[_BoolT_co]):
__slots__ = ("maketuple",)

maketuple: _BoolT_co
def __init__(self, maketuple: _BoolT_co) -> None: ...
@overload
Expand Down
2 changes: 2 additions & 0 deletions numpy/lib/mixins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ __all__ = ["NDArrayOperatorsMixin"]
# As such, only little type safety can be provided here.

class NDArrayOperatorsMixin(ABC):
__slots__ = ()

@abstractmethod
def __array_ufunc__(
self,
Expand Down
4 changes: 4 additions & 0 deletions numpy/ma/extras.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,16 @@ def cov(x, y=None, rowvar=True, bias=False, allow_masked=True, ddof=None): ...
def corrcoef(x, y=None, rowvar=True, bias=..., allow_masked=True, ddof=...): ...

class MAxisConcatenator(AxisConcatenator):
__slots__ = ()

@staticmethod
def concatenate(arrays: Incomplete, axis: int = 0) -> Incomplete: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
@classmethod
def makemat(cls, arr: Incomplete) -> Incomplete: ... # type: ignore[override] # pyright: ignore[reportIncompatibleVariableOverride]

class mr_class(MAxisConcatenator):
__slots__ = ()

def __init__(self) -> None: ...

mr_: mr_class
Expand Down
Loading