Skip to content

Commit f0834bc

Browse files
Conventions header was throwing inconsistent level warning. Fixed this and later headings to match rest of page.
1 parent d8bc875 commit f0834bc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/writing/style.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -416,12 +416,12 @@ Then run it on a file or series of files to get a report of any violations.
416416
optparse.py:544:21: W601 .has_key() is deprecated, use 'in'
417417

418418
Conventions
419-
:::::::::::
419+
----------------
420420

421421
Here are some conventions you should follow to make your code easier to read.
422422

423423
Check if variable equals a constant
424-
-----------------------------------
424+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
425425

426426
You don't need to explicitly compare a value to True, or None, or 0 - you can
427427
just add it to the if statement. See `Truth Value Testing
@@ -455,7 +455,7 @@ list of what is considered false.
455455
print 'attr is None!'
456456
457457
Access a Dictionary Element
458-
---------------------------
458+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
459459

460460
Don't use the ``has_key`` function. Instead use ``x in d`` syntax, or pass
461461
a default argument to ``get``.
@@ -484,7 +484,7 @@ a default argument to ``get``.
484484
print d['hello']
485485
486486
Short Ways to Manipulate Lists
487-
------------------------------
487+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
488488

489489
`List comprehensions
490490
<http://docs.python.org/tutorial/datastructures.html#list-comprehensions>`_
@@ -548,7 +548,7 @@ manually. Moreover,
548548
it is better optimized for iterators.
549549

550550
Read From a File
551-
----------------
551+
~~~~~~~~~~~~~~~~
552552

553553
Use the ``with open`` syntax to read from files. This will automatically close
554554
files for you.
@@ -574,7 +574,7 @@ The ``with`` statement is better because it will ensure you always close the
574574
file, even if an exception is raised.
575575

576576
Returning Multiple Values from a Function
577-
-----------------------------------------
577+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
578578

579579
Python supports returning multiple values from a function as a comma-separated
580580
list, so you don't have to create an object or dictionary and pack multiple

0 commit comments

Comments
 (0)