Skip to content

pbdoc needed? #4992

Closed Answered by bethebunny
MatthijsBurgh asked this question in Q&A
Discussion options

You must be logged in to vote

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. The pbdoc 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…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MatthijsBurgh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants