Conversation
At runtime, the type caster will convert between Python `None` and an empty `std::function` object. However, the emitted stubs do not reflect this fact
|
Hi @tjstum, if what you say is correct, it looks to me like an undocumented omission/bug. The only nanobind argument types that can take |
|
It can take None only if I find handling None to be a convenient feature rather than a bug. As it is now, the user explicitly adds If wrapping in IMO adding The documentation is not accurate here – I tried to bring it up in #683. |
|
Yeah, this actually first showed up in properties (e.g. @wjakob I'm not entirely sure I understand what you are saying about wrapping with |
|
I talked to @oremanj offline about this for a while. Another downside of this approach is that, if you have a So I'll give this some more thought and see if we can come up with a different proposal. But it's sort of a tricky situation, with a type caster being willing to accept/return |
At runtime, the type caster will convert between Python
Noneand an emptystd::functionobject. However, the emitted stubs do not reflect this fact