Commit Graph

4 Commits

Author SHA1 Message Date
William S Fulton 632cf8fee5 [Python] Unify class docstring under -builtin with non-builtin
The autodoc-class fallback in make_autodoc() and the no-docstring
fallback in classHandler() both emitted "::ClassName" under -builtin
where the non-builtin proxy module emits "Proxy of C++ ClassName class."
(or "" when no docstring source is in scope).

Collapse the AUTODOC_CLASS builtin branch so the autodoc-derived text
is identical in both modes, drop the classHandler -builtin block that
seeded feature:python:tp_doc with "::ClassName" when have_docstring is
false, and initialise quoted_tp_doc_str to an empty string rather than
the literal "0" so the tp_doc slot becomes "" instead of inheriting
SwigPyObject's docstring via the MRO lookup that inspect.getdoc() does
on a NULL tp_doc.

Drop the is_python_builtin() gates that this divergence had forced into
autodoc_runme.py, doxygen_autodoc_docstring_runme.py and
doxygen_misc_constructs_runme.py, plus the matching #ifdef
SWIGPYTHON_BUILTIN helpers in doxygen_autodoc_docstring.i and
doxygen_misc_constructs.i. The autodoc.i helper stays - autodoc_runme.py
still needs it to gate the _autodoc.* low-level checks that genuinely
do not exist under -builtin.

The autodoc-driven __init__ checks in autodoc_runme.py also drop their
skip=True guards: 2f8cdc412 already made cdocstring(node, AUTODOC_CTOR)
flow into python:tp_init_doc for autodoc-only constructors as well as
doxygen ones, so the descriptor adapter installs the expected
"__init__(self, ...) -> Foo" string in -builtin too.

Assisted-by: Claude Opus 4.7 (1M context)
2026-05-26 08:37:07 +01:00
William S Fulton da07af7fe2 doxygen_autodoc_docstring test fix for Python builtin 2022-04-06 22:33:17 +01:00
William S Fulton 19a872eab7 Temporarily disable doxygen_autodoc_docstring_runme.py 2022-04-06 20:51:37 +01:00
William S Fulton b35ebc81a9 Doxygen comments take precedence over the autodoc feature.
If a "docstring" feature is present it will still override a Doxygen comment.
If the "autodoc" feature is also present, the combined "autodoc" and "docstring"
will override the Doxygen comment. If no "docstring" is present then the
"autodoc" feature will not be generated when there is a Doxygen comment.

This way the "autodoc" feature can be specified and used to provide documentation
for 'missing' Doxygen comments.

Closes #1635
2022-04-06 08:08:14 +01:00