mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 23:10:17 +00:00
apparently, not closing LIs and Ps is also a hard habit to break
This commit is contained in:
+1
-1
@@ -173,7 +173,7 @@ class Fib:
|
||||
<li>To spit out the next value, an iterator’s <code>__next__()</code> method simply <code>return</code>s the value. Do not use <code>yield</code> here; that’s a bit of syntactic sugar that only applies when you’re using generators. Here you’re creating your own iterator from scratch; use <code>return</code> instead.
|
||||
</ol>
|
||||
|
||||
<p>Thoroughly confused yet? Excellent. Let’s see how to call this iterator:</p>
|
||||
<p>Thoroughly confused yet? Excellent. Let’s see how to call this iterator:
|
||||
|
||||
<pre class=screen>
|
||||
<samp class=p>>>> </samp><kbd>from fibonacci2 import Fib</kbd>
|
||||
|
||||
Reference in New Issue
Block a user