Fix duplication of docs in extend_command#282
Fix duplication of docs in extend_command#282czgdp1807 wants to merge 2 commits intoscientific-python:mainfrom
extend_command#282Conversation
Signed-off-by: Gagandeep Singh <gdp.1807@gmail.com>
Signed-off-by: Gagandeep Singh <gdp.1807@gmail.com>
|
This actually seems to be covered already by the Lines 128 to 130 in fee6abe Did you try using that to get the desired docstring contents? |
|
So according to that documentation, adding |
|
Yes. Makes sense. However isn't that confusing? I think, it should be, cc: @stefanv |
|
The idea here is to give the user maximal flexibility in how they define their docstrings, either via a keyword argument or by setting the new function docstring. The latter is only possible if you override the original, which is achieved by setting |
|
I've tried to improve the description of this functionality in #310 |
Originally reported in scipy/scipy#23041 (comment)
extend_commandduplicates doc strings of commands decorated withextend_command. Whatever commands I have tried in SciPy, all have docs from the originalspinfunction and the SciPy function of the command. Take a look at the following examples,spin shell --help(in SciPy),spin docs --help(in SciPy)I think the problem is with the following line,
spin/spin/cmds/util.py
Line 175 in fee6abe
If both,
my_cmd.helpanduser_func.__doc__will be present then both will be combined. In my opinion, better idea would be to give priority touser_func.__doc__if it is present. Otherwise, fallback tomy_cmd.help.In this PR, the outputs of the above commands look like as follows,