New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOC: add_newdocs should happen before PyType_Ready #10167
Comments
The problem with generating the header file at compile time is that fixing a typo in one docstring now causes that header file to change, and now every single C file which includes that header has to be recompiled. For testing whether a sphinx construct renders correctly, this is a huge burden. Perhaps we need to generate a Or at least, generate a header per C file that we currently have. |
Would it be terrible to move the actual docstrings into IIUC the only reason they're in a |
Or, you could autogen the C files. Writing it in python files avoids dealing with C quoting and the "\n" everywhere... |
I guess I don't care that much -- it's not like we have any shortage of autogen code already :-) If we do this, then instead of generating |
For one idea how to use a function to generate docstrings in header files, see the code in pnumpy |
Change
add_newdocs
to e.g. generate a header file at compile time with the docs (as is done in scipy.special), rather than patching them at runtime afterPyType_Ready
. Requires some hunting for the correct places to specify the docstrings. The current waytp_doc
is hacked (afterPyTypeReady
) not only leaks thechar*
string yanked out of thePyStringObject
, it does not work on PyPy.gleaned from #10157, plagarized @pv 's hints
The text was updated successfully, but these errors were encountered: