Seamlessly conversion nullableString (publicly inherited from std::string) to Python and back.
Issue description
I have a class which inherits directly from the std::string class but also has the concept of 'null' versus empty (""). This is an important distinction because of it understanding "on the wire" IPC traffic which has different and important distinctions between null and "".
When a method is invoked that returns my class nullableString, Python complains with the following error: what(): TypeError: Unable to convert function return value to a Python type! The signature was (self: Module.GetReply) -> nullableString
I've looked at the documentation and include custom type_casters but it's not clear how to use this to handle the conversion. I am looking at potentially using a custom type caster with pybind11, however, I'm hoping to find a simpler way since the only difference between my class and string is the concept of a null string. All regular methods (c_str(), begin(), end() etc.) are directly accessible to call.
I can add reproducible code, however, it is likely to be less succinct than this explanation.
Thanks, Salah
I figured it. out.