Closed mdorier closed 1 year ago
Hi, thanks for the report.
PyCapsule
does not provide any python interface to interact with, therefore it would be perfectly fine to annotate it as Any
_my_capsule: typing.Any # PyCapsule()
... or even remove it from the stubs altogether (since you can't do much with it from python).
I'm inclined to implement the first option.
Closed by 106712441fd5ce4d6a6130d7c52d5b9160ac0738
I have a pybind11-based library that uses capsules (
pybind11::capsule
). When I try to use the stubs generated by pybind11-stubgen with mypy, I'm getting a lot of errors like the following:This can be fixed by manually adding the "capsule" class to init.pyi, but it would be better if pybind11-stubgen could do it by itself.