Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TYP: fix sliding_window_view axis parameter typing#31330

Merged
charris merged 1 commit into
numpy:maintenance/2.4.xfrom
charris:backport-31240
Apr 25, 2026
Merged

TYP: fix sliding_window_view axis parameter typing#31330
charris merged 1 commit into
numpy:maintenance/2.4.xfrom
charris:backport-31240

Conversation

@charris
Copy link
Copy Markdown
Member

@charris charris commented Apr 25, 2026

Backport of #31240.

Backport of #31240.

The axis parameter now accepts int | tuple[int, ...] instead of just SupportsIndex, matching the documentation and implementation.

Fixes #31233

Good day,

The axis parameter in sliding_window_view now accepts int | tuple[int, ...] instead of just SupportsIndex, matching the documentation and implementation.

This fixes the type inconsistency issue reported in #31233.

Changes:

  • Changed axis: SupportsIndex | None to axis: int | tuple[int, ...] | None in both overloads in numpy/lib/_stride_tricks_impl.pyi

Thank you for your work on this project. I hope this small fix is helpful. Please let me know if there is anything to adjust.

Warmly, RoomWithOutRoof

The axis parameter now accepts int | tuple[int, ...] instead of just
SupportsIndex, matching the documentation and implementation.

Fixes numpy#31233
@charris charris added this to the 2.4.5 release milestone Apr 25, 2026
@charris charris added 08 - Backport Used to tag backport PRs 41 - Static typing labels Apr 25, 2026
@charris charris merged commit 3fd878b into numpy:maintenance/2.4.x Apr 25, 2026
12 checks passed
@charris charris deleted the backport-31240 branch April 25, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 - Backport Used to tag backport PRs 41 - Static typing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant