Skip to content

TYP: stack shape-typing - #32248

Merged
charris merged 2 commits into
numpy:mainfrom
jorenham:typing/stack/shape-typing
Aug 11, 2026
Merged

charris merged 2 commits into
numpy:mainfrom
jorenham:typing/stack/shape-typing

Conversation

@jorenham

Copy link
Copy Markdown
Member

Same story as #32238


Mechanical work done by AI (these stack overloads are very similar to vstack/hstack). It messed up here and there, so I changed some stuff myself afterwards.

@jorenham jorenham added this to the 2.6.0 Release milestone Aug 11, 2026
@jorenham
jorenham force-pushed the typing/stack/shape-typing branch from 2050629 to 7f3949d Compare August 11, 2026 10:51
@github-actions

Copy link
Copy Markdown

Diff from mypy_primer, showing the effect of this PR on type check results on a corpus of open source code:

jax (https://github.com/google/jax)
- jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:729: error: Incompatible types in assignment (expression has type "ndarray[tuple[Any, ...], dtype[bool[Any]]]", variable has type "list[ndarray[tuple[Any, ...], dtype[Any]]] | None")  [assignment]
+ jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:729: error: Incompatible types in assignment (expression has type "ndarray[Any, dtype[bool[Any]]]", variable has type "list[ndarray[tuple[Any, ...], dtype[Any]]] | None")  [assignment]

optuna (https://github.com/optuna/optuna)
  ./optuna/study/_multi_objective.py:182: error: INTERNAL ERROR -- Please try using mypy master on GitHub:

@charris
charris merged commit 1019066 into numpy:main Aug 11, 2026
14 checks passed
@charris

charris commented Aug 11, 2026

Copy link
Copy Markdown
Member

Thanks Joren.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants