-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Ability to disable overloaded function signatures being presented when autodoc_typehints
is "signature"
or "both"
#10359
Comments
I fully support this request. I prefer to explain the different usages of overloaded functions but show only the signature of the actual function (with a "universal" signature). Listing all individual overloads can really hurt the readability, IMO. Is there a workaround possible, currently? I tried to see if I could achieve this with the Minor point: the overloaded signatures are also shown if |
I would love to have this as an option. The docs can become unreadable quickly if you have any mildly complex overloading going on. For example, this is the |
It shouldn't be that hard to do with a configuration value. What we do is redocumenting all possible signatures so we could simply skip this step. Controlling something at the level of the function should be done via But this would require a complete refactorisation of autodoc (which IMHO should be done because it's really hard to extend existing implementations). A note for the future me: the code responsible for detecting overloaded functions is the ModuleAnalyzer IIRC. It's one of the component that needs to be improved one day in order to also detect imports correctly and also to be able to subclass it correctly in extensions (currently its implementation is tightly coupled with autodoc and it becomes a pain for extensions that want to improvr it). At one point I want to collect every autodoc issues because there arr many that are the same or have the same cause. As a matter of fact, since Python 3.11 or 12, overloaded functions are known at runtime (which is not the case prior to that since the |
Any updates on this? |
Is your feature request related to a problem? Please describe.
![Code_7hPM5g2RLm](https://user-images.githubusercontent.com/16031716/163714868-2a0bb6b1-5ecf-4361-b9b4-8612c8d6d65e.png)
When the setting above is present and enabled, the build documentation presents multiple entries for ov
erloaded function signature:
Describe the solution you'd like
As discussed in #10305 I would like to request a setting to override within
conf.py
to disable this functionality only.Describe alternatives you've considered
Due to the overloaded signatures being rather important, I am unsure if it would be possible to perhaps "collapse" these and only show one signature, but have a button/link present in the built documentation to reveal the overloaded signatures.
Otherwise perhaps it can
Additional context
N/A but can present anything if you need.
The text was updated successfully, but these errors were encountered: