summaryrefslogtreecommitdiffstats
path: root/Doc/howto/functional.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-10-04 18:33:26 (GMT)
committerGeorg Brandl <georg@python.org>2008-10-04 18:33:26 (GMT)
commit0df797943cc46af236cce9c15e98c475f7ecccf0 (patch)
tree431d14d4336f0489878f7bf24a75426dac20535f /Doc/howto/functional.rst
parentb186f3438419a6c881705a42db1ecc4e52f5241e (diff)
downloadcpython-0df797943cc46af236cce9c15e98c475f7ecccf0.zip
cpython-0df797943cc46af236cce9c15e98c475f7ecccf0.tar.gz
cpython-0df797943cc46af236cce9c15e98c475f7ecccf0.tar.bz2
#4000: fix several 2.x atavisms.
Diffstat (limited to 'Doc/howto/functional.rst')
-rw-r--r--Doc/howto/functional.rst10
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/howto/functional.rst b/Doc/howto/functional.rst
index 2e09358..d0e31e8 100644
--- a/Doc/howto/functional.rst
+++ b/Doc/howto/functional.rst
@@ -69,9 +69,9 @@ output must only depend on its input.
Some languages are very strict about purity and don't even have assignment
statements such as ``a=3`` or ``c = a + b``, but it's difficult to avoid all
side effects. Printing to the screen or writing to a disk file are side
-effects, for example. For example, in Python a ``print`` statement or a
-``time.sleep(1)`` both return no useful value; they're only called for their
-side effects of sending some text to the screen or pausing execution for a
+effects, for example. For example, in Python a call to the :func:`print` or
+:func:`time.sleep` function both return no useful value; they're only called for
+their side effects of sending some text to the screen or pausing execution for a
second.
Python programs written in functional style usually won't go to the extreme of
@@ -1031,8 +1031,8 @@ value and an iterator for the elements with that key.
...
]
- def get_state ((city, state)):
- return state
+ def get_state (city_state):
+ return city_state[1]
itertools.groupby(city_list, get_state) =>
('AL', iterator-1),