You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unless I'm missing something, this is because bool_ is missing in __init__.pyi.
This was done in gh-25080. There's some discussion in that PR; if needed we can revisit the decision, but in principle non-recommended aliases (as well as deprecated items) are not exposed in .pyi files.
In principle I don't see an issue with adding back np.bool_ as an alias of np.bool for a while (eventually we should remove it though I think). I think it wasn't discussed carefully enough in gh-25080. The hard work done there was to update all the .pyi files to make np.bool canonical and used everywhere in the 2.0 type stubs. At the end np.bool_ could have been added back though, since package authors cannot unconditionally use np.bool yet as long as they support numpy 1.x.
Describe the issue:
Type checkers (tested with
pyright==1.1.356
in strict mode) don't recognizenp.bool_
as alias fornp.bool
onnumpy==2.0.0rc1
.Unless I'm missing something, this is because
bool_
is missing in__init__.pyi
.Reproduce the code example:
Error message:
Python and NumPy Versions:
Runtime Environment:
No response
Context for the issue:
This makes it impossible to add support for both numpy 1 and 2 in typed python packages, e.g. in https://github.com/jorenham/Lmo/blob/master/lmo/typing.py
The text was updated successfully, but these errors were encountered: