-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
autodoc: fix ordering of class and static methods for groupwise
order
#13201
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! As noted in the PR description, this should have some documentation (at least a CHANGES entry).
A
Yes, I planned to do that but I wanted to first hear your thoughts on this. I'll open a separate issue if you want but I'll definitely add the CHANGELOG and update the docs. |
No need for a distinct issue. |
I don't have an issue yet (but I'll create one and update the changelog once I'm done) but I've found the issue while working on #13200.
Class and static methods were meant to be ordered before regular methods when using
groupwise
order but this was not respected until now. The reason is that we callsort_members
before callinggenerate
(which is fine). However,generate()
actually callsimport_object
which itself modifiesmember_order
(because that's the first time we have the actual object and we can inspect it without relying on static analysis).So, we need to decouple
import_object
fromgenerate
. To avoid breaking stuff for now, I've added a private_generate()
method which is the actual implementation ofgenerate()
so that I can call it separately. Current uses ofgenerate()
remain the same.