Replies: 1 comment
-
Agreed, people have been requesting this for years (eg. #3175, #3377). Pointers in C/C++ can be null. Seems rather a basic aspect to support. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Similar to sizmailov/pybind11-stubgen#181, I am trying to indicate in the type hints of my pybind11-wrapped code that a value of None is permitted, as this will be converted to nullptr by pybind11.
Currently the pybind11 docstring of a pointer or smart pointer is simply the contained type.
To bypass the current default
name
for ashared_ptr<Foo>
, I can use the following:name
fortype_caster<std::shared_ptr<T>>
andtype_caster<std::unique_ptr<T>>
in cast.h be welcome?name
can be overridden for raw pointers...Beta Was this translation helpful? Give feedback.
All reactions