Skip to content

Commit

Permalink
Fix formatting, shorten long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
aaaaalbert authored Jun 18, 2018
1 parent ca85c23 commit 532c834
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,15 +472,15 @@ than lines of code!
## Documentation Strings ##

Conventions for writing good documentation strings (a.k.a. "docstrings")
are immortalized in [http://www.python.org/dev/peps/pep-0257/ PEP 257]
are immortalized in [PEP 257](http://www.python.org/dev/peps/pep-0257/).

Write docstrings for all public modules, functions, classes, and methods.
Docstrings are not necessary for non-public methods, but you should have a
comment that describes what the method does. This comment should appear after
the "def" line.
the `def` line.


Note that most importantly, the """ that ends a multiline docstring should be
Note that most importantly, the `"""` that ends a multiline docstring should be
on a line by itself, and preferably preceded by a blank line, e.g.:

```python
Expand All @@ -497,7 +497,8 @@ line.

Example documentation strings for files, modules, and classes.

Each module should have a header block that specifies its file name and explains the purpose (and any caveats or issues) of the module.
Each module should have a header block that specifies its file name and
explains the purpose (and any caveats or issues) of the module.

```python
"""
Expand Down Expand Up @@ -681,10 +682,11 @@ firstname, surname = get_full_name()
print("Hello, Mr. " + surname)
```

The majority of tools for static code analysis complain if a variable is assigned but not used thereafter.
By convention, unused values are assigned to `i`, `j`, `k`, and `_` (underscore character) and
are understood as such. However, we think `junk` is more readable than `_` and easier for
newcomers to understand.
The majority of tools for static code analysis complain if a variable is
assigned but not used thereafter. By convention, unused values are assigned
to `i`, `j`, `k`, and `_` (underscore character) and are understood as such.
However, we think `junk` is more readable than `_` and easier for newcomers
to understand.

### Exception Names ###

Expand Down Expand Up @@ -1071,7 +1073,7 @@ else:

Writing the code the first way is hard for someone to read. The second two
ways make it more clear that you are relying on the short circuit evaluation to
perform or avoid the evaluation of the askokcancel function.
perform or avoid the evaluation of the `askokcancel` function.


### Don't use os.popen or os.system ###
Expand Down

0 comments on commit 532c834

Please sign in to comment.