Skip to content
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

autoclass: Method order incorrect if automethod is used #13170

Open
TTSPhilipp opened this issue Dec 6, 2024 · 1 comment
Open

autoclass: Method order incorrect if automethod is used #13170

TTSPhilipp opened this issue Dec 6, 2024 · 1 comment
Labels

Comments

@TTSPhilipp
Copy link

Describe the bug

If automethod is used in autoclass, then the method is always placed at the top, regardless of which option was selected for member-order.

My expectation:
The Call(...) method should be displayed at the place where the original Call method would have been, since bysource was selected for member-order.

An alternative would be if I could set a parameter for automethod to define where the method should be displayed.

It would also be okay if the method is simply appended below.

How to Reproduce

.. autoclass:: MyClass
    :special-members: __init__
    :member-order: bysource
    :members:
    :no-undoc-members:
    :exclude-members: Call

    .. automethod:: Call(...)

Environment Information

Platform:              win32; (Windows-10-10.0.26100-SP0)
Python version:        3.11.9 (tags/v3.11.9:de54cf5, Apr  2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)])
Python implementation: CPython
Sphinx version:        8.1.3
Docutils version:      0.21.2
Jinja2 version:        3.1.4
Pygments version:      2.18.0

Sphinx extensions

["sphinx.ext.autodoc"]

Additional context

No response

@electric-coder
Copy link

electric-coder commented Dec 6, 2024

My expectation:
The Call(...) method should be displayed at the place where the original Call method would have been, since bysource was selected for member-order.

In fact it shouldn't, those options have always been independent in that members automatically included by the enclosing directive precede those that are explicitly declared in its scope.

This report (that isn't a bug but an FR) doesn't include a MRE because it lacks the necessary Python declarations and it also lacks a screenshot to show unambiguously what the problem is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants