Skip to content

CLN: Update docstring decorator from Appender and Substitution to doc #31942

Open
@HH-MWB

Description

@HH-MWB

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions