@@ -335,7 +335,7 @@ Instead, use a list comprehension:
335335 four_lists = [[] for __ in xrange (4 )]
336336
337337
338- A common idiom for creating strings is to use ` join < http://docs.python.org/library/string.html#string. join>`_ on an empty string.::
338+ A common idiom for creating strings is to use :py:meth: ` str. join` on an empty string.::
339339
340340 letters = ['s', 'p', 'a', 'm']
341341 word = ''.join(letters)
@@ -433,7 +433,7 @@ Check if variable equals a constant
433433~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
434434
435435You don't need to explicitly compare a value to True, or None, or 0 - you can
436- just add it to the if statement. See `Truth Value Testing
436+ just add it to the if statement. See :ref: `Truth Value Testing
437437<http://docs.python.org/library/stdtypes.html#truth-value-testing>`_ for a
438438list of what is considered false.
439439
@@ -466,8 +466,8 @@ list of what is considered false.
466466Access a Dictionary Element
467467~~~~~~~~~~~~~~~~~~~~~~~~~~~
468468
469- Don't use the `` has_key `` function . Instead use ``x in d `` syntax, or pass
470- a default argument to `` get ` `.
469+ Don't use the :py:meth:`dict. has_key` method . Instead, use ``x in d `` syntax,
470+ or pass a default argument to :py:meth: ` dict. get `.
471471
472472**Bad **:
473473
@@ -497,10 +497,9 @@ Short Ways to Manipulate Lists
497497
498498`List comprehensions
499499<http://docs.python.org/tutorial/datastructures.html#list-comprehensions> `_
500- provide a powerful, concise way to work with lists. Also, the `map
501- <http://docs.python.org/library/functions.html#map> `_ and `filter
502- <http://docs.python.org/library/functions.html#filter> `_ functions can perform
503- operations on lists using a different concise syntax.
500+ provide a powerful, concise way to work with lists. Also, the :py:func: `map `
501+ :py:func: `filter ` functions can perform operations on lists using a different,
502+ more concise syntax.
504503
505504**Bad **:
506505
@@ -540,8 +539,7 @@ operations on lists using a different concise syntax.
540539 # Or:
541540 a = map (lambda i : i + 3 , a)
542541
543- Use `enumerate <http://docs.python.org/library/functions.html#enumerate >`_ to
544- keep a count of your place in the list.
542+ Use :py:func: `enumerate ` keep a count of your place in the list.
545543
546544.. code-block :: python
547545
@@ -552,9 +550,8 @@ keep a count of your place in the list.
552550 # 1 4
553551 # 2 5
554552
555- The ``enumerate `` function has better readability than handling a counter
556- manually. Moreover,
557- it is better optimized for iterators.
553+ The :py:func: `enumerate ` function has better readability than handling a
554+ counter manually. Moreover, it is better optimized for iterators.
558555
559556Read From a File
560557~~~~~~~~~~~~~~~~
0 commit comments