Fix/14576 autodoc data signature - #14616
Open
itsvedantkumar wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Hi, the bug was that autodoc doesn't build a signature for data objects. The problem was that its internal signature list is empty for them -- and when an autodoc-process-signature event handler returns a replacement signature, the code wrote it to index 0 of that empty list and ctashed with Indexerror (the docstring then got lost & a warning was printed.)
Fix: the change basically appends the handler's signature when the list is empty & behaves exactly as before when it isn't
Proof: a regression test is also included that reproduces the IndexError without the fix and passes with it; the full autodoc test suite was run with no new failures; CHANGES.rst and AUTHORS.rst entries are included
References
Fixes #14576
AI Disclosure
Claude Fable was used to develop the patch & the test under my direction -- I have reviewed the change & understand it, per the AI policy