66 static constexpr const char* py_typing =
"T | None";
68 static PyObject* build(
const std::optional<T>& value)
74 return PyExportTraits<T>::build(*value);
76 static int get(PyObject* obj, std::optional<T>& value)
84 if (PyExportTraits<T>::get(obj, tmp) != 0)
88 value = std::move(tmp);
Wrapper to type-hint return values in Python that maybe None but not likely.
Comprehensive C++ to Python binding library.
Library for Assembled Shared Sources.
Helper class to create PyExportTraits for MaybeNone wrapped types.
by copy, general case assumes shadow type or PyObjectPlus based type.