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
Currently when declaring a method that returns the result of py::make_iterator(), the type signature in the docstring uses the return type iterator, which is not a valid Python type. In the example below we see the docstring:
__iter__(self: numbers.Numbers) -> iterator\n
I was hoping that the type could instead be switched to either typing.Iterator or Iterator.
The use case where this is coming up:
I'm generating type stubs of a pybind module using stubgen. When running mypy with the generated stubs I see the following error:
I'm going to include this under the same issue because it seems very similar; the py::none type declares it's type in a docstring as none, but I would expected it to be None so that it produces a valid Python type.
Issue description
Currently when declaring a method that returns the result of
py::make_iterator()
, the type signature in the docstring uses the return typeiterator
, which is not a valid Python type. In the example below we see the docstring:I was hoping that the type could instead be switched to either
typing.Iterator
orIterator
.The use case where this is coming up:
I'm generating type stubs of a pybind module using stubgen. When running mypy with the generated stubs I see the following error:
Reproducible example code
The text was updated successfully, but these errors were encountered: