Replies: 1 comment
-
The I agree that it would be nice if Sphinx could just not render the Therefore, I have a request: could you raise this with the Sphinx team and report back if there is a way to achieve this? We could explicitly document Sphinx settings/tweaks that make this tool better-behaved with nanobind-based projects. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
when it generates signature strings, nanobind uses the long form of typing names. For instance, I have an argument typed:
collections.abc.Callable[[collections.abc.Sequence[int]], bool]
, and this string ends up in the documentation as is when I generate it with Sphinx and autodoc.Personally, I don't like the
collections.abc.
part. It is long, carries basically 0 information, and makes the whole signature harder to read. When it generates signatures from pure Python code, by default Sphinx's autodoc suppresses the module name from the typehints, and I'd like to get the same behavior between the Python and C++/nanobind parts of my package. Now the question is how to achieve that.collections.abc.
. However, I haven't seen the advice that to generate the doc, one should first generate stubs, and then feed the stubs to sphinx. This doesn't look like what stubs are for.Do you have any advice? Is it important for some applications to keep
collections.abc.
in the signature? Would a new nanobind flag to control this behavior make sense? Should stubs be used for this?Beta Was this translation helpful? Give feedback.
All reactions