scipy/scipy-stubs

`select_range` params in `scipy.linalg._decomp` can only be `int{16,32,64}` if `select="i"`

Closed this issue · 0 comments

In #153 (comment) @pavyamsiri discovered that the the private _EigSelectRange type-alias in scipy.linalg._decomp is too broad if select.lower() in {2, "i", "index"}.

https://github.com/jorenham/scipy-stubs/blob/1318f8438051822d1dca15b5a3d5f0aad40f260b/scipy-stubs/linalg/_decomp.pyi#L26C1-L26C16

https://github.com/scipy/scipy/blob/v1.14.1/scipy/linalg/_decomp.py#L645-L650

Note that because _EigSelectRange is only used for parameter types (i.e. contravariantly), this technically isn't a bug. But even so, disallowing int8 in this case could be very helpful to avoid crashes at runtime.