question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CLN: Update docstring decorator from Appender and Substitution to doc

See original GitHub issue

We 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:open
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
farhanreynaldocommented, Mar 2, 2020

Because the docstring use { and }. Can you suggest on what should I do?

Hi @farhanreynaldo, I would suggest that we replace { with {{ and replace } with }} here.

It works! Thank you, @HH-MWB

0reactions
HH-MWBcommented, Mar 1, 2020

Because the docstring use { and }. Can you suggest on what should I do?

Hi @farhanreynaldo, I would suggest that we replace { with {{ and replace } with }} here.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found