Feature Request: Add default parameter values to docstring
See original GitHub issueCurrently the docstrings for Module
subclasses don’t display the default argument values when using ?
. Not sure if there is an automated way to display this, or to update all of the docstrings.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
What is the standard way for writing default values in a python ...
I have a function with parameters set to default values. I'm using a NumPy-style docstring, but I've seen the default values written ...
Read more >Python Docstring: Documenting And Introspecting Functions
A dict containing default values for keyword-only parameters. A str which is the function name. A str which is the function's qualified name....
Read more >Python docstring: some default arguments values are missing
Hi, we're thinking of moving from 2.0.12 to 3.0.12 (it's about time), but one thing holding us back at the moment is that...
Read more >pandas docstring guide - Python-Sprints
For keyword arguments with a default value, the default will be listed after a comma at the end of the type. The exact...
Read more >Documenting Python APIs with docstrings
Optional keyword parameters have default values, which are automatically documented as part of the function or method's signature. You can also explain defaults...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, this will probably be because it’s grabbing the metaclass
__call__
rather than using the class__init__
. (I supposehelp
must have some special-casing internally to not exhibit the same behaviour fortype.__call__
.)I think overriding
cls.__signature__
is probably the correct thing to do. I’d be happy to accept a PR fixing this.I’m not sure what you mean about
?
- I assume this is in reference to some piece of tooling you use?In any case, I’d be happy to include default parameters in docstrings. It may be possible to do this in automated fashion either now or in the future. See this Reddit thread.