Skip to content

Commit cefa740

Browse files
author
Kenneth Reitz
committed
Merge pull request realpython#207 from andrewmacgregor/master
Fixes for warnings in docs
2 parents 2a7c091 + 1336375 commit cefa740

File tree

6 files changed

+18
-16
lines changed

6 files changed

+18
-16
lines changed

docs/intro/community.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _the_community:
1+
.. _the-community:
22

33
The Community
44
=============

docs/intro/learning.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ Python Koans
6565

6666
Python Koans is a port of Edgecase's Ruby Koans. It uses a test-driven
6767
approach, q.v. TEST DRIVEN DESIGN SECTION to provide an interactive tutorial
68-
teaching basic python concepts. By fixing assertion statements that fail in a
69-
test script, this provides sequential steps to learning python.
68+
teaching basic python concepts. By fixing assertion statements that fail in a
69+
test script, this provides sequential steps to learning python.
7070

7171
For those used to languages and figuring out puzzles on their own, this can be
7272
a fun, attractive option. For those new to python and programming, having an

docs/scenarios/db.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Nearly all Python database modules such as `sqlite3`, `psycopg` and
1010
`mysql-python` conform to this interface.
1111

1212
Tutorials that explain how to work with modules that conform to this interface can be found
13-
`here <http://halfcooked.com/presentations/osdc2006/python_databases.html>`_ and
14-
`here <http://www.amk.ca/python/writing/DB-API.html>`_.
13+
`here <http://halfcooked.com/presentations/osdc2006/python_databases.html>`__ and
14+
`here <http://www.amk.ca/python/writing/DB-API.html>`__.
1515

1616
SQLAlchemy
1717
----------

docs/starting/which-python.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Picking an Interpreter
22
======================
33

4+
.. _which-python:
5+
46
Which Python to use?
57

68

docs/writing/structure.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ logic (called pure functions) allow the following benefits:
266266
- Pure functions are easier to test with unit-tests: There is less
267267
need for complex context setup and data cleaning afterwards.
268268

269-
- Pure functions are easier to manipulate, decorate_, and pass-around.
269+
- Pure functions are easier to manipulate, decorate, and pass-around.
270270

271271
In summary, pure functions, without any context or side-effects, are more
272272
efficient building blocks than classes and objects for some architectures.

docs/writing/style.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ Those two possibilities are better avoided without any strong reason to not
114114
follow the syntax that is the closest to the function definition: ``send('Hello',
115115
'World', cc='Cthulhu', bcc='God')``.
116116

117-
As a side note, following YAGNI_ principle, it is often harder to remove an
118-
optional argument (and its logic inside the function) that was added "just in
119-
case" and is seemingly never used, than to add a new optional argument and its
120-
logic when needed.
117+
As a side note, following `YAGNI <http://en.wikipedia.org/wiki/You_ain't_gonna_need_it>`_
118+
principle, it is often harder to remove an optional argument (and its logic inside the
119+
function) that was added "just in case" and is seemingly never used, than to add a
120+
new optional argument and its logic when needed.
121121

122122
The **arbitrary argument list** is the third way to pass arguments to a
123123
function. If the function intention is better expressed by a signature with an
@@ -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)