[Python-checkins] r50523 - sandbox/trunk/Doc/functional.rst
andrew.kuchling
python-checkins at python.org
Mon Jul 10 19:13:47 CEST 2006
Author: andrew.kuchling
Date: Mon Jul 10 19:13:47 2006
New Revision: 50523
Modified:
sandbox/trunk/Doc/functional.rst
Log:
Change variable names for consistency; bump version again
Modified: sandbox/trunk/Doc/functional.rst
==============================================================================
--- sandbox/trunk/Doc/functional.rst (original)
+++ sandbox/trunk/Doc/functional.rst Mon Jul 10 19:13:47 2006
@@ -1,7 +1,7 @@
Functional Programming HOWTO
================================
-**Version 0.2**
+**Version 0.21**
(This is a first draft. Please send comments/error
reports/suggestions to amk at amk.ca. This URL is probably not going to
@@ -853,7 +853,7 @@
::
- freq = reduce(lambda a, b: (0, a[1] + b[1]), items)[1]
+ total = reduce(lambda a, b: (0, a[1] + b[1]), items)[1]
You can figure it out, but it takes time to disentangle the expression
to figure out what's going on. Using a short nested
@@ -862,7 +862,7 @@
def combine (a, b):
return 0, a[1] + b[1]
- return reduce(combine, items)[1]
+ total = reduce(combine, items)[1]
But it would be best of all if I had simply used a ``for`` loop::
More information about the Python-checkins
mailing list