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.

[docs] use consistent style for docstrings

See original GitHub issue

If I am not mistaken, I think @chrissimpkins has set up Sphinx to automatically format docstrings using the Google Style. Among other things, these include an Args list of parameters, Returns (or Yields for generators) for the return value, Raises for any exceptions, etc. More info here:

https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html https://github.com/google/styleguide/blob/gh-pages/pyguide.md#38-comments-and-docstrings

In light of @simoncozens’ latest efforts on documentation, it would be nice if we could agree and stick to one style for documenting code. The Google style seems to be among the most popular in the python community, and sphinx/RTD support this nicely so I’d propose we use that one.

WDYT?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
anthrotypecommented, May 12, 2020

Agreed

1reaction
simoncozenscommented, May 12, 2020

Yeah, we should definitely use Google style. I’ll do a second pass later fixing up all the docstrings, so please don’t let this be a blocker for my incoming PRs. Some docs are better than no docs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Example Google Style Python Docstrings - Napoleon
coding: utf-8 -*- """Example Google style docstrings. This module demonstrates documentation as specified by the `Google Python Style Guide`_.
Read more >
What are the most common Python docstring formats? [closed]
You can get some information about the main formats in this blog post. There follows the main used formats for docstrings.
Read more >
Google Python Style Guide
Style guides for Google-originated open-source projects.
Read more >
Python Docstrings Tutorial : Examples & Format for Pydoc ...
Python documentation string or commonly known as docstring, is a string literal, and it is used in the class, module, function, or method...
Read more >
Google Python Style Guide for Drake
(Try running pydoc on your module to see how it looks.) Always use the three double-quote """ format for docstrings (per PEP 257)....
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