Skip to content

Commit

Permalink
Merge pull request #656 from swcarpentry/martinosorb-patch-2
Browse files Browse the repository at this point in the history
add more detailed description of comments vs docstrings
  • Loading branch information
alee authored Jul 29, 2023
2 parents 6c9c18c + e737863 commit 703664a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions episodes/18-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ def overall_max(sequences):

## Document This

Use comments to describe and help others understand potentially unintuitive
sections or individual lines of code. They are especially useful to whoever
may need to understand and edit your code in the future, including yourself.

Use docstrings to document the acceptable inputs and expected outputs of a method
or class, its purpose, assumptions and intended behavior. Docstrings are displayed
when a user invokes the builtin `help` method on your method or class.

Turn the comment in the following function into a docstring
and check that `help` displays it properly.

Expand Down

0 comments on commit 703664a

Please sign in to comment.