mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 15:00:18 +00:00
removed stray notes about caching
This commit is contained in:
+2
-2
@@ -314,8 +314,8 @@ rules = LazyRules()</code></pre>
|
||||
return funcs</code></pre>
|
||||
<ol>
|
||||
<li>The <code>__next__()</code> method gets called whenever someone — say, a <code>for</code> loop — calls <code>next(rules)</code>. This method will only make sense if we start at the end and work backwards. So let’s do that.
|
||||
<li>The last part of this function should look familiar, at least. The <code>build_match_and_apply_functions()</code> function hasn’t changed; it’s the same as it ever was. <em>Each line of the pattern file will be read exactly once, as late as possible.</em>
|
||||
<li>The only difference is that, before returning the match and apply functions (which are stored in the tuple <var>funcs</var>), we’ve going to save them in <code>self.cache</code>. <em>Each match and apply function will be built exactly once, as late as possible, then cached.</em>
|
||||
<li>The last part of this function should look familiar, at least. The <code>build_match_and_apply_functions()</code> function hasn’t changed; it’s the same as it ever was.
|
||||
<li>The only difference is that, before returning the match and apply functions (which are stored in the tuple <var>funcs</var>), we’ve going to save them in <code>self.cache</code>.
|
||||
</ol>
|
||||
|
||||
<p>Moving backwards…
|
||||
|
||||
Reference in New Issue
Block a user