apparently, not closing LIs and Ps is also a hard habit to break

This commit is contained in:
Mark Pilgrim
2009-05-21 19:15:46 -04:00
parent 3cd1fbc28f
commit 2f49195ffd
5 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -173,7 +173,7 @@ class Fib:
<li>To spit out the next value, an iterator&#8217;s <code>__next__()</code> method simply <code>return</code>s the value. Do not use <code>yield</code> here; that&#8217;s a bit of syntactic sugar that only applies when you&#8217;re using generators. Here you&#8217;re creating your own iterator from scratch; use <code>return</code> instead.
</ol>
<p>Thoroughly confused yet? Excellent. Let&#8217;s see how to call this iterator:</p>
<p>Thoroughly confused yet? Excellent. Let&#8217;s see how to call this iterator:
<pre class=screen>
<samp class=p>>>> </samp><kbd>from fibonacci2 import Fib</kbd>