Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

TYP: fix stubtest errors in numpy._core #28511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 14, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
TYP: fix typing errors in _core.function_base
Partial port of numpy/numtype#221
  • Loading branch information
jorenham committed Mar 14, 2025
commit 3f72cc4e9ae3d6a1997fa03a8b8bb2b49bdf3fa0
91 changes: 62 additions & 29 deletions 91 numpy/_core/function_base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def linspace(
dtype: None = ...,
axis: SupportsIndex = ...,
*,
device: None | L["cpu"] = ...,
) -> NDArray[floating[Any]]: ...
device: L["cpu"] | None = ...,
) -> NDArray[floating]: ...
@overload
def linspace(
start: _ArrayLikeComplex_co,
Expand All @@ -41,19 +41,31 @@ def linspace(
dtype: None = ...,
axis: SupportsIndex = ...,
*,
device: None | L["cpu"] = ...,
) -> NDArray[complexfloating[Any, Any]]: ...
device: L["cpu"] | None = ...,
) -> NDArray[complexfloating]: ...
@overload
def linspace(
start: _ArrayLikeComplex_co,
stop: _ArrayLikeComplex_co,
num: SupportsIndex,
endpoint: bool,
retstep: L[False],
dtype: _DTypeLike[_SCT],
axis: SupportsIndex = ...,
*,
device: L["cpu"] | None = ...,
) -> NDArray[_SCT]: ...
@overload
def linspace(
start: _ArrayLikeComplex_co,
stop: _ArrayLikeComplex_co,
num: SupportsIndex = ...,
endpoint: bool = ...,
retstep: L[False] = ...,
dtype: _DTypeLike[_SCT] = ...,
axis: SupportsIndex = ...,
*,
device: None | L["cpu"] = ...,
dtype: _DTypeLike[_SCT],
axis: SupportsIndex = ...,
device: L["cpu"] | None = ...,
) -> NDArray[_SCT]: ...
@overload
def linspace(
Expand All @@ -65,55 +77,55 @@ def linspace(
dtype: DTypeLike = ...,
axis: SupportsIndex = ...,
*,
device: None | L["cpu"] = ...,
device: L["cpu"] | None = ...,
) -> NDArray[Any]: ...
@overload
def linspace(
start: _ArrayLikeFloat_co,
stop: _ArrayLikeFloat_co,
num: SupportsIndex = ...,
endpoint: bool = ...,
retstep: L[True] = ...,
*,
retstep: L[True],
dtype: None = ...,
axis: SupportsIndex = ...,
*,
device: None | L["cpu"] = ...,
) -> tuple[NDArray[floating[Any]], floating[Any]]: ...
device: L["cpu"] | None = ...,
) -> tuple[NDArray[floating], floating]: ...
@overload
def linspace(
start: _ArrayLikeComplex_co,
stop: _ArrayLikeComplex_co,
num: SupportsIndex = ...,
endpoint: bool = ...,
retstep: L[True] = ...,
*,
retstep: L[True],
dtype: None = ...,
axis: SupportsIndex = ...,
*,
device: None | L["cpu"] = ...,
) -> tuple[NDArray[complexfloating[Any, Any]], complexfloating[Any, Any]]: ...
device: L["cpu"] | None = ...,
) -> tuple[NDArray[complexfloating], complexfloating]: ...
@overload
def linspace(
start: _ArrayLikeComplex_co,
stop: _ArrayLikeComplex_co,
num: SupportsIndex = ...,
endpoint: bool = ...,
retstep: L[True] = ...,
dtype: _DTypeLike[_SCT] = ...,
axis: SupportsIndex = ...,
*,
device: None | L["cpu"] = ...,
retstep: L[True],
dtype: _DTypeLike[_SCT],
axis: SupportsIndex = ...,
device: L["cpu"] | None = ...,
) -> tuple[NDArray[_SCT], _SCT]: ...
@overload
def linspace(
start: _ArrayLikeComplex_co,
stop: _ArrayLikeComplex_co,
num: SupportsIndex = ...,
endpoint: bool = ...,
retstep: L[True] = ...,
*,
retstep: L[True],
dtype: DTypeLike = ...,
axis: SupportsIndex = ...,
*,
device: None | L["cpu"] = ...,
device: L["cpu"] | None = ...,
) -> tuple[NDArray[Any], Any]: ...

@overload
Expand All @@ -125,7 +137,7 @@ def logspace(
base: _ArrayLikeFloat_co = ...,
dtype: None = ...,
axis: SupportsIndex = ...,
) -> NDArray[floating[Any]]: ...
) -> NDArray[floating]: ...
@overload
def logspace(
start: _ArrayLikeComplex_co,
Expand All @@ -135,15 +147,26 @@ def logspace(
base: _ArrayLikeComplex_co = ...,
dtype: None = ...,
axis: SupportsIndex = ...,
) -> NDArray[complexfloating[Any, Any]]: ...
) -> NDArray[complexfloating]: ...
@overload
def logspace(
start: _ArrayLikeComplex_co,
stop: _ArrayLikeComplex_co,
num: SupportsIndex,
endpoint: bool,
base: _ArrayLikeComplex_co,
dtype: _DTypeLike[_SCT],
axis: SupportsIndex = ...,
) -> NDArray[_SCT]: ...
@overload
def logspace(
start: _ArrayLikeComplex_co,
stop: _ArrayLikeComplex_co,
num: SupportsIndex = ...,
endpoint: bool = ...,
base: _ArrayLikeComplex_co = ...,
dtype: _DTypeLike[_SCT] = ...,
*,
dtype: _DTypeLike[_SCT],
axis: SupportsIndex = ...,
) -> NDArray[_SCT]: ...
@overload
Expand All @@ -165,7 +188,7 @@ def geomspace(
endpoint: bool = ...,
dtype: None = ...,
axis: SupportsIndex = ...,
) -> NDArray[floating[Any]]: ...
) -> NDArray[floating]: ...
@overload
def geomspace(
start: _ArrayLikeComplex_co,
Expand All @@ -174,14 +197,24 @@ def geomspace(
endpoint: bool = ...,
dtype: None = ...,
axis: SupportsIndex = ...,
) -> NDArray[complexfloating[Any, Any]]: ...
) -> NDArray[complexfloating]: ...
@overload
def geomspace(
start: _ArrayLikeComplex_co,
stop: _ArrayLikeComplex_co,
num: SupportsIndex,
endpoint: bool,
dtype: _DTypeLike[_SCT],
axis: SupportsIndex = ...,
) -> NDArray[_SCT]: ...
@overload
def geomspace(
start: _ArrayLikeComplex_co,
stop: _ArrayLikeComplex_co,
num: SupportsIndex = ...,
endpoint: bool = ...,
dtype: _DTypeLike[_SCT] = ...,
*,
dtype: _DTypeLike[_SCT],
axis: SupportsIndex = ...,
) -> NDArray[_SCT]: ...
@overload
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.