CLN: Update docstring decorator from Appender and Substitution to doc
See original GitHub issueWe use to use Appender
and Substitution
decorators to share docstring cross functions. Now we implemented a new decorator doc
for that use case, and it would simplify the reuse of docstrings.
The idea here is to replace Appender
and Substitution
with doc
decorator, and move the shared docstring to a better place if possible.
Example
The original code will be look like this:
@Substitution(**_shared_doc_kwargs)
@Appender(NDFrame.fillna.__doc__)
def fillna(self, value=None, ...) -> Optional["DataFrame"]:
return super().fillna(...)
We would like to change it to this:
@doc(NDFrame.fillna, **_shared_doc_kwargs)
def fillna(self, value=None, ...) -> Optional["DataFrame"]:
return super().fillna(...)
Reference
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Change the docstring of a class method within a decorator ...
Sphinx loads everything and gathers docstrings, but it does not do anything more. Based on the selected solution, I added a module variable...
Read more >Github stats — Matplotlib 1.4.2 documentation
PR #3369: Added legend.framealpha to rcParams, as mentioned in axes.legend docstring; PR #3510: Fix setupext [backport to 1.4.x]; PR #3530: Only insert links ......
Read more >https://mirrors.aliyun.com/macports/release/ports/...
... qt5-qtdeclarative-docs 90023 qt5-qtserialport 90851 qt5-qtserialport-docs ... qscintilla 1805839 qscintilla-qt4 1807307 qscintilla-designer-qt4 1808421 ...
Read more >Matplotlib
mand to trigger a figure update, and also provides a matplotlib aware run command to run matplotlib scripts efficiently. ipython will turn ...
Read more >OpenSuSE Leap 15.3 for s390x
commit.d · init.d · list-installed.d · post-install.d · pre-commit.d · pre-install.d · unclean.d · uninit.d · update-ignore.d · vcs.d.
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
It works! Thank you, @HH-MWB
Hi @farhanreynaldo, I would suggest that we replace
{
with{{
and replace}
with}}
here.