mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 15:00:18 +00:00
really fixed numbering
This commit is contained in:
+2
-2
@@ -252,8 +252,8 @@ rules = LazyRules()</code></pre>
|
||||
rules_filename = 'plural6-rules.txt'
|
||||
|
||||
<a> def __iter__(self): <span class=u>①</span></a>
|
||||
<a> self.pattern_file = open(self.rules_filename) <span class=u>③</span></a>
|
||||
<a> self.cache = [] <span class=u>②</span></a>
|
||||
<a> self.pattern_file = open(self.rules_filename) <span class=u>②</span></a>
|
||||
<a> self.cache = [] <span class=u>③</span></a>
|
||||
self.cache_index = 0</code></pre>
|
||||
<ol>
|
||||
<li>The <code>__iter__()</code> method is only going to be called once, after you instantiate the class, assign it to <var>rules</var>, and call <code>iter(rules)</code> to create the iterator.
|
||||
|
||||
Reference in New Issue
Block a user