Skip to content

[DOC] avoid C++ types in docstrings#2441

Merged
YannickJadoul merged 4 commits into
pybind:masterfrom
sizmailov:avoid-cpp-types-in-docstrings
Sep 1, 2020
Merged

[DOC] avoid C++ types in docstrings#2441
YannickJadoul merged 4 commits into
pybind:masterfrom
sizmailov:avoid-cpp-types-in-docstrings

Conversation

@sizmailov

Copy link
Copy Markdown
Contributor

Here is a small paragraph about docstring generation in pybind11. Also replicates @YannickJadoul 's example from #2263.

I'm not sure if misc.rst is the best place for it.

render

image

@sizmailov sizmailov force-pushed the avoid-cpp-types-in-docstrings branch from 42c8829 to b6354ba Compare August 27, 2020 19:02
@sizmailov sizmailov force-pushed the avoid-cpp-types-in-docstrings branch from a6abf2c to a22833d Compare August 27, 2020 19:03

@YannickJadoul YannickJadoul left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things I would personally phrase slightly differently (up to you to decide if you like it better or not), but looks succinct and good to me!

misc.rst seems find. I don't immediately see another place where we talk about docstrings and signature. It's right underneath the only other section about it ("Generating documentation using Sphinx"), so perfect for me!

Thanks for taking the time to create this, @sizmailov! :-)

Comment thread docs/advanced/misc.rst Outdated
Comment thread docs/advanced/misc.rst Outdated
Comment thread docs/advanced/misc.rst Outdated
Comment thread docs/advanced/misc.rst Outdated
@YannickJadoul

Copy link
Copy Markdown
Collaborator

Great, thanks! Let's see if someone else still has something to add. If not, this can go in as-is, afaic :-)

Comment thread docs/advanced/misc.rst Outdated

@bstaletic bstaletic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sizmailov Thanks for the PR

@sizmailov

Copy link
Copy Markdown
Contributor Author

Thanks everybody for quick and thoughtful reviews with great attention to even subtle things!

@YannickJadoul YannickJadoul merged commit 4c36fb7 into pybind:master Sep 1, 2020
@YannickJadoul

Copy link
Copy Markdown
Collaborator

More like, thanks @sizmailov for making this PR and fixing all our minor remarks ;-) Thanks a lot!

@patrislav1

patrislav1 commented Jun 15, 2023

Copy link
Copy Markdown

How to solve this if Foo and Bar are in different pybind11 modules?

EDIT: solved it, Foo just needs additional line py::module_::import("Bar");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants