summaryrefslogtreecommitdiff
path: root/numpy/lib
diff options
context:
space:
mode:
authorBas van Beek <b.f.van.beek@vu.nl>2021-08-31 12:03:27 +0200
committerBas van Beek <b.f.van.beek@vu.nl>2021-08-31 12:06:25 +0200
commit45e43d72494a993188d809ef676fe3648a79e7bf (patch)
treeec0ac1f971d1d60109cedae8ed07181c6119986f /numpy/lib
parentb21ad7c5ee0cd76ea41bb519877804457d1776f8 (diff)
downloadnumpy-45e43d72494a993188d809ef676fe3648a79e7bf.tar.gz
STY: Use the PEP 457 positional-only syntax in the stub files
Diffstat (limited to 'numpy/lib')
-rw-r--r--numpy/lib/arraypad.pyi9
-rw-r--r--numpy/lib/npyio.pyi7
-rw-r--r--numpy/lib/shape_base.pyi10
-rw-r--r--numpy/lib/utils.pyi5
4 files changed, 18 insertions, 13 deletions
diff --git a/numpy/lib/arraypad.pyi b/numpy/lib/arraypad.pyi
index d6e07a6bd..49ce8e683 100644
--- a/numpy/lib/arraypad.pyi
+++ b/numpy/lib/arraypad.pyi
@@ -24,10 +24,11 @@ _SCT = TypeVar("_SCT", bound=generic)
class _ModeFunc(Protocol):
def __call__(
self,
- __vector: NDArray[Any],
- __iaxis_pad_width: Tuple[int, int],
- __iaxis: int,
- __kwargs: Dict[str, Any],
+ vector: NDArray[Any],
+ iaxis_pad_width: Tuple[int, int],
+ iaxis: int,
+ kwargs: Dict[str, Any],
+ /,
) -> None: ...
_ModeKind = L[
diff --git a/numpy/lib/npyio.pyi b/numpy/lib/npyio.pyi
index 1321afb55..1fa689bbe 100644
--- a/numpy/lib/npyio.pyi
+++ b/numpy/lib/npyio.pyi
@@ -80,9 +80,10 @@ class NpzFile(Mapping[str, NDArray[Any]]):
def __enter__(self: _T) -> _T: ...
def __exit__(
self,
- __exc_type: None | Type[BaseException],
- __exc_value: None | BaseException,
- __traceback: None | types.TracebackType,
+ exc_type: None | Type[BaseException],
+ exc_value: None | BaseException,
+ traceback: None | types.TracebackType,
+ /,
) -> None: ...
def close(self) -> None: ...
def __del__(self) -> None: ...
diff --git a/numpy/lib/shape_base.pyi b/numpy/lib/shape_base.pyi
index 4c275cc8c..1598dc36c 100644
--- a/numpy/lib/shape_base.pyi
+++ b/numpy/lib/shape_base.pyi
@@ -38,15 +38,17 @@ _ArrayLike = _NestedSequence[_SupportsDType[dtype[_SCT]]]
class _ArrayWrap(Protocol):
def __call__(
self,
- __array: NDArray[Any],
- __context: None | Tuple[ufunc, Tuple[Any, ...], int] = ...,
+ array: NDArray[Any],
+ context: None | Tuple[ufunc, Tuple[Any, ...], int] = ...,
+ /,
) -> Any: ...
class _ArrayPrepare(Protocol):
def __call__(
self,
- __array: NDArray[Any],
- __context: None | Tuple[ufunc, Tuple[Any, ...], int] = ...,
+ array: NDArray[Any],
+ context: None | Tuple[ufunc, Tuple[Any, ...], int] = ...,
+ /,
) -> Any: ...
class _SupportsArrayWrap(Protocol):
diff --git a/numpy/lib/utils.pyi b/numpy/lib/utils.pyi
index c13a219b5..f0a8797ad 100644
--- a/numpy/lib/utils.pyi
+++ b/numpy/lib/utils.pyi
@@ -26,7 +26,7 @@ _FuncType = TypeVar("_FuncType", bound=Callable[..., Any])
# A file-like object opened in `w` mode
class _SupportsWrite(Protocol[_T_contra]):
- def write(self, __s: _T_contra) -> Any: ...
+ def write(self, s: _T_contra, /) -> Any: ...
__all__: List[str]
@@ -55,7 +55,8 @@ def deprecate(
) -> _Deprecate: ...
@overload
def deprecate(
- __func: _FuncType,
+ func: _FuncType,
+ /,
old_name: Optional[str] = ...,
new_name: Optional[str] = ...,
message: Optional[str] = ...,