iterators and generators chapter

--HG--
rename : humansize.py => examples/humansize.py
rename : roman1.py => examples/roman1.py
rename : roman2.py => examples/roman2.py
rename : roman3.py => examples/roman3.py
rename : roman4.py => examples/roman4.py
rename : roman5.py => examples/roman5.py
rename : roman6.py => examples/roman6.py
rename : roman7.py => examples/roman7.py
rename : roman8.py => examples/roman8.py
rename : romantest1.py => examples/romantest1.py
rename : romantest2.py => examples/romantest2.py
rename : romantest3.py => examples/romantest3.py
rename : romantest4.py => examples/romantest4.py
rename : romantest5.py => examples/romantest5.py
rename : romantest6.py => examples/romantest6.py
rename : romantest7.py => examples/romantest7.py
rename : romantest8.py => examples/romantest8.py
This commit is contained in:
Mark Pilgrim
2009-03-27 01:43:33 -05:00
parent 18b0144075
commit 933dc9459a
52 changed files with 2247 additions and 695 deletions
+2 -1
View File
@@ -19,7 +19,7 @@ td pre{padding:0;border:0}
</head>
<form action=http://www.google.com/cse><div><input type=hidden name=cx value=014021643941856155761:l5eihuescdw><input type=hidden name=ie value=UTF-8>&nbsp;<input name=q size=31>&nbsp;<input type=submit name=sa value=Search></div></form>
<p>You are here: <a href=index.html>Home</a> <span>&#8227;</span> <a href=table-of-contents.html#porting-code-to-python-3-with-2to3>Dive Into Python 3</a> <span>&#8227;</span>
<h1>Porting code to Python 3 with <code>2to3</code></h1>
<h1>Porting Code to Python 3 with <code>2to3</code></h1>
<blockquote class=q>
<p><span>&#x275D;</span> Life is pleasant. Death is peaceful. It&#8217;s the transition that&#8217;s troublesome. <span>&#x275E;</span><br>&mdash; Isaac Asimov (attributed)
</blockquote>
@@ -495,6 +495,7 @@ for an_iterator in a_sequence_of_iterators:
reduce(a, b, c)</code></pre></td></tr>
</table>
<blockquote>
<!-- FIXME reduce() removal from Guido: http://www.artima.com/weblogs/viewpost.jsp?thread=98196 -->
<p><span>&#x261E;</span>The version of <code>2to3</code> that shipped with Python 3.0 would not fix the <code>reduce()</code> function automatically. The fix first appeared in the <code>2to3</code> script that shipped with Python 3.1.
</blockquote>
<h2 id=apply><code>apply()</code> global function</h2>