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
but how do I actually put them to use? I have the numpy-stubs (git+https://github.com/numpy/numpy-stubs.git@c49d2d6875971a669a166ea93ef998911af283a1) installed, but validating the above results in
error: "ndarray" expects no type arguments, but 2 given [type-arg]
for the ndarray parameters and
error: Bad number of arguments for type alias, expected: 0, given: 2
on the same line (for _Shape I guess?).
At the moment I regex the additional type information away before feeding it to numpy, but how is this actually supposed to be used?
The text was updated successfully, but these errors were encountered:
Numpy generics are not supported by mypy and other tools as far as I know. Therefore type & shape information needs to be discarded to use mypy. There is a long-standing issue on mypy python/typing#513.
Note that numpy-stubs repo is obsolete and stubs are included in main numpy repo.
Therefore type & shape information needs to be discarded to use mypy
If that is the case, shouldn't pybind11-stubgen output all occurrences of numpy.ndarray without any type and shape information? Or is there some other application where that information can be put to use?
At the moment, the code generated from pybind11-stubgen (0.6.0) has numpy types like
but how do I actually put them to use? I have the numpy-stubs (
git+https://github.com/numpy/numpy-stubs.git@c49d2d6875971a669a166ea93ef998911af283a1
) installed, but validating the above results infor the ndarray parameters and
on the same line (for
_Shape
I guess?).At the moment I regex the additional type information away before feeding it to numpy, but how is this actually supposed to be used?
The text was updated successfully, but these errors were encountered: