pipetools icon indicating copy to clipboard operation
pipetools copied to clipboard

Docstrings

Open hamzamohdzubair opened this issue 3 years ago • 2 comments

What is a good practice or recommendation for writing docstrings that are simple and clean to write and work well with documentation tools.

Related Stackoverflow quesion

hamzamohdzubair avatar Jul 15 '21 12:07 hamzamohdzubair

I would use standard Python docstring in a def statement, see answer.

It would be possible to add some docstring feature to pipe so you could do something like this:

get_py_files = pipe("Get all Python files from directory") | os.listdir | where(X.endswith('.py'))

Not sure if it's worth it.

0101 avatar Jul 15 '21 13:07 0101

I see this library becoming the standard for people who think functionally. Writing functions like this in a large codebase is simply impractical given the importance of docstrings for large code bases. I would say it's definitely worth it.

hamzamohdzubair avatar Jul 15 '21 13:07 hamzamohdzubair