pbdoc needed? #4992
-
Is it really needed to add the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
No, it's not needed, you can supply the docstring via any code mechanism you want that has type The syntax I don't know for sure, but I suspect "pbdoc" is a compromise being short for "pybind-docstring" but also short to type and wouldn't otherwise commonly exist in code or documentation. |
Beta Was this translation helpful? Give feedback.
No, it's not needed, you can supply the docstring via any code mechanism you want that has type
string
.The syntax
R"pbdoc(...)pbdoc"
is a raw string literal. This allows things like double quotes to appear in the string literal. Thepbdoc
isn't special, it's just trying to create a sequence of characters that are very unlikely to appear in the wild to end the string literal. This feature is especially useful when trying to generate PyBind definitions - you'd have to have a generated string that includes somethirg like)pbdoc"
I don't know for sure, but I suspect "pbdoc" is a compromise being short for "pybind-docstring" but also short to type and wouldn't otherwise commonly exist in code…