Commits

Anonymous committed 15e9498

Fixed bug in Makefile

Comments (0)

Files changed (51)

html/CanonicalScript.html

     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>

html/Comprehensions.html

 <p>They require a mind shift.</p>
 <p>What makes them so compelling (once you &#8216;get it&#8217;)?</p>
 <p>A two-level list comprehension using <tt class="docutils literal"><span class="pre">os.walk()</span></tt>:</p>
-<div class="highlight"><pre><span class="c"># Comprehensions/os_walk_comprehension.py</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="c"># Comprehensions/os_walk_comprehension.py</span>
 <span class="kn">import</span> <span class="nn">os</span>
 <span class="n">restFiles</span> <span class="o">=</span> <span class="p">[</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">d</span><span class="p">[</span><span class="mf">0</span><span class="p">],</span> <span class="n">f</span><span class="p">)</span> <span class="k">for</span> <span class="n">d</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">walk</span><span class="p">(</span><span class="s">&quot;.&quot;</span><span class="p">)</span>
              <span class="k">for</span> <span class="n">f</span> <span class="ow">in</span> <span class="n">d</span><span class="p">[</span><span class="mf">2</span><span class="p">]</span> <span class="k">if</span> <span class="n">f</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="s">&quot;.rst&quot;</span><span class="p">)]</span>
 <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">restFiles</span><span class="p">:</span>
     <span class="k">print</span><span class="p">(</span><span class="n">r</span><span class="p">)</span>
 </pre></div>
+</div>
 <div class="section" id="a-more-complex-example">
 <h2>A More Complex Example<a class="headerlink" href="#a-more-complex-example" title="Permalink to this headline">¶</a></h2>
 <div class="admonition note">
 <p class="last">This is still under development. After finishing, it will get a full
 description of all parts.</p>
 </div>
-<div class="highlight"><pre><span class="c"># comprehensions/CodeManager.py</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="c"># comprehensions/CodeManager.py</span>
 <span class="sd">&quot;&quot;&quot;</span>
 <span class="sd">TODO: update() is still only in test mode; doesn&#39;t actually work yet.</span>
 <span class="sd">TODO: check() should generate deltas</span>
 </pre></div>
 </div>
 </div>
+</div>
 
 
           </div>
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>

html/Contributors.html

     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="top" title="Python 3 Patterns & Idioms" href="index.html" />
-    <link rel="next" title="A Note To Readers" href="NoteToReaders.html" />
+    <link rel="next" title="ToDo List" href="ToDo.html" />
     <link rel="prev" title="Python 3 Patterns &amp; Idioms" href="index.html" />
   </head>
   <body>
           <a href="genindex.html" title="General Index"
              accesskey="I">index</a></li>
         <li class="right" >
-          <a href="NoteToReaders.html" title="A Note To Readers"
+          <a href="ToDo.html" title="ToDo List"
              accesskey="N">next</a> |</li>
         <li class="right" >
           <a href="index.html" title="Python 3 Patterns &amp; Idioms"
 3.0 to refactor the language.</li>
 </ul>
 </blockquote>
+<hr class="docutils" />
+<div class="admonition-todo admonition " id="todo-2">
+<p class="first admonition-title">Todo</p>
+<p>Yarko (example label of ToDo):</p>
+<ul class="last simple">
+<li>update CSS styles for todo&#8217;s &amp; todo lists;</li>
+<li>look at <a class="reference external" href="http://sphinx.pocoo.org/ext/coverage.html">http://sphinx.pocoo.org/ext/coverage.html</a> for example.</li>
+<li>Autogenerated ToDoLists do not appear in LaTeX output - debug, fix;</li>
+<li>DONE:
+- ToDo does not appear to be created by make dependencies (it&#8217;s autogenerated);
+- update Makefile to always re-generate todo lists;</li>
+</ul>
+</div>
 </div>
 </div>
 
             <h4>Previous topic</h4>
             <p class="topless"><a href="index.html" title="previous chapter">Python 3 Patterns &amp; Idioms</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="NoteToReaders.html" title="next chapter">A Note To Readers</a></p>
+            <p class="topless"><a href="ToDo.html" title="next chapter">ToDo List</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
               <li><a href="_sources/Contributors.txt">Show Source</a></li>
           <a href="genindex.html" title="General Index"
              accesskey="I">index</a></li>
         <li class="right" >
-          <a href="NoteToReaders.html" title="A Note To Readers"
+          <a href="ToDo.html" title="ToDo List"
              accesskey="N">next</a> |</li>
         <li class="right" >
           <a href="index.html" title="Python 3 Patterns &amp; Idioms"
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>

html/CoroutinesAndConcurrency.html

             
   
   <div class="section" id="coroutines-concurrency">
-<span id="index-6"></span><h1>Coroutines &amp; Concurrency<a class="headerlink" href="#coroutines-concurrency" title="Permalink to this headline">¶</a></h1>
+<span id="index-3"></span><h1>Coroutines &amp; Concurrency<a class="headerlink" href="#coroutines-concurrency" title="Permalink to this headline">¶</a></h1>
 <p>Primary focus should be on:</p>
 <ol class="arabic simple">
 <li>Using <tt class="docutils literal"><span class="pre">yield</span></tt> to create coroutines</li>
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>

html/DeveloperGuide.html

 <blockquote>
 <tt class="docutils literal"><span class="pre">build</span> <span class="pre">help</span></tt></blockquote>
 <p>to see the options.</p>
+<div class="admonition-todo admonition " id="todo-4">
+<p class="first admonition-title">Todo</p>
+<p class="last">The remainder of this document needs rewriting. Rewrite this section for BitBucket &amp; Mercurial; make some project specific diagrams;</p>
 </div>
-<div class="section" id="working-with-bitbucket-and-mercurial">
-<h2>Working with BitBucket and Mercurial<a class="headerlink" href="#working-with-bitbucket-and-mercurial" title="Permalink to this headline">¶</a></h2>
+<p>Working with BitBucket and Mercurial</p>
+<hr class="docutils" />
 <div class="admonition note">
 <p class="first admonition-title">Note</p>
-<p class="last">The remainder of this document needs rewriting.</p>
+<p class="last">Adapted from a posting by Yarko Tymciurak</p>
 </div>
-<p>(Adapted from a posting by Yarko T)</p>
 <p>This assumes that you have created a local branch on your private machine where
 you do work, and keep it merged with the trunk.</p>
 <p>That is, you&#8217;ve done:</p>
 <blockquote>
 <ul class="simple">
+<li>Forked a branch of <a class="reference external" href="http://www.bitbucket.org/BruceEckel/python-3-patterns-idioms/">http://www.bitbucket.org/BruceEckel/python-3-patterns-idioms/</a> (the main trunk; this fork will provide a place for review and comment)</li>
+<li>cloned the trunk to your local machine:
+- hg clone <a class="reference external" href="https://my_login&#64;bitbucket.org/BruceEckel/python-3-patterns-idioms/">https://my_login&#64;bitbucket.org/BruceEckel/python-3-patterns-idioms/</a></li>
+<li>cloned your local copy of trunk to create a working directory:
+- hg clone python-3-patterns-idioms devel</li>
+</ul>
+</blockquote>
+<div class="admonition-todo admonition " id="todo-5">
+<p class="first admonition-title">Todo</p>
+<p>This section still work in progress:</p>
+<ul class="last simple">
 <li><tt class="docutils literal"><span class="pre">hg</span> <span class="pre">branch</span> <span class="pre">lp:python3patterns</span></tt></li>
 <li><tt class="docutils literal"><span class="pre">hg</span> <span class="pre">commit</span> <span class="pre">-m</span> <span class="pre">'initial</span> <span class="pre">checkout'</span></tt></li>
 <li>(hack, hack, hack....)</li>
 <li><tt class="docutils literal"><span class="pre">hg</span> <span class="pre">commit</span> <span class="pre">-m</span> <span class="pre">'checkin</span> <span class="pre">after</span> <span class="pre">merge...'</span></tt></li>
 <li>... and so on...</li>
 </ul>
-</blockquote>
+</div>
 <p>When you have a new function idea, or think you&#8217;ve found a bug, ask Bruce
 on the group.</p>
 <blockquote>
 <p>When you are ready to share your work have others review, register a branch.</p>
 <div class="admonition note">
 <p class="first admonition-title">Note</p>
-<p class="last">Once you create a branch, there is no easy way to remove it.</p>
-</div>
-<div class="admonition note">
-<p class="first admonition-title">Note</p>
 <p class="last">You can re-use one branch for multiple bug fixes.</p>
 </div>
 <ol class="arabic simple">
 <li><a class="reference external" href="#installing-sphinx">Installing Sphinx</a></li>
 <li><a class="reference external" href="#getting-the-development-branch-of-the-book">Getting the Development Branch of the Book</a></li>
 <li><a class="reference external" href="#building-the-book">Building the Book</a></li>
-<li><a class="reference external" href="#working-with-bitbucket-and-mercurial">Working with BitBucket and Mercurial</a></li>
 </ul>
 </li>
 </ul>
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>

html/GeneratorsIterators.html

             
   
   <div class="section" id="generators-iterators-and-itertools">
-<span id="index-3"></span><h1>Generators, Iterators, and Itertools<a class="headerlink" href="#generators-iterators-and-itertools" title="Permalink to this headline">¶</a></h1>
+<span id="index-6"></span><h1>Generators, Iterators, and Itertools<a class="headerlink" href="#generators-iterators-and-itertools" title="Permalink to this headline">¶</a></h1>
 </div>
 
 
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>

html/Introduction.html

     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>

html/LanguageChanges.html

             
   
   <div class="section" id="python-3-language-changes">
-<span id="index-4"></span><h1>Python 3 Language Changes<a class="headerlink" href="#python-3-language-changes" title="Permalink to this headline">¶</a></h1>
+<span id="index-7"></span><h1>Python 3 Language Changes<a class="headerlink" href="#python-3-language-changes" title="Permalink to this headline">¶</a></h1>
 <p>Covers language features that don&#8217;t require their own chapters.</p>
 <div class="admonition note">
 <p class="first admonition-title">Note</p>
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>

html/MachineDiscovery.html

 but it falls short. Here&#8217;s a rather messy, but useful way to figure out
 everything else.</p>
 <p>Just a starting point:</p>
-<div class="highlight"><pre><span class="k">def</span> <span class="nf">detectCPUs</span><span class="p">():</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">detectCPUs</span><span class="p">():</span>
     <span class="sd">&quot;&quot;&quot;</span>
 <span class="sd">    Detects the number of CPUs on a system. Cribbed from pp.</span>
 <span class="sd">    &quot;&quot;&quot;</span>
     <span class="k">return</span> <span class="mf">1</span> <span class="c"># Default</span>
 </pre></div>
 </div>
+</div>
 
 
           </div>
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>

html/NoteToReaders.html

     <link rel="search" title="Search" href="search.html" />
     <link rel="top" title="Python 3 Patterns & Idioms" href="index.html" />
     <link rel="next" title="Introduction" href="Introduction.html" />
-    <link rel="prev" title="Contributors" href="Contributors.html" />
+    <link rel="prev" title="ToDo List" href="ToDo.html" />
   </head>
   <body>
     <div class="related">
           <a href="Introduction.html" title="Introduction"
              accesskey="N">next</a> |</li>
         <li class="right" >
-          <a href="Contributors.html" title="Contributors"
+          <a href="ToDo.html" title="ToDo List"
              accesskey="P">previous</a> |</li>
         <li><a href="index.html">Python 3 Patterns & Idioms</a> &raquo;</li>
       </ul>
     
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="Contributors.html" title="previous chapter">Contributors</a></p>
+            <p class="topless"><a href="ToDo.html" title="previous chapter">ToDo List</a></p>
             <h4>Next topic</h4>
             <p class="topless"><a href="Introduction.html" title="next chapter">Introduction</a></p>
             <h3>This Page</h3>
           <a href="Introduction.html" title="Introduction"
              accesskey="N">next</a> |</li>
         <li class="right" >
-          <a href="Contributors.html" title="Contributors"
+          <a href="ToDo.html" title="ToDo List"
              accesskey="P">previous</a> |</li>
         <li><a href="index.html">Python 3 Patterns & Idioms</a> &raquo;</li>
       </ul>
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>

html/PythonDecorators.html

             
   
   <div class="section" id="decorators">
-<span id="index-5"></span><h1>Decorators<a class="headerlink" href="#decorators" title="Permalink to this headline">¶</a></h1>
+<span id="index-8"></span><h1>Decorators<a class="headerlink" href="#decorators" title="Permalink to this headline">¶</a></h1>
 <div class="admonition note">
 <p class="first admonition-title">Note</p>
 <p class="last">This chapter is a work in progress; it&#8217;s probably better if you don&#8217;t
 suppose you&#8217;d like to do something at the entry and exit points of a function
 (such as perform some kind of security, tracing, locking, etc. &#8211; all the
 standard arguments for AOP). With decorators, it looks like this:</p>
-<div class="highlight"><pre><span class="nd">@entryExit</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="nd">@entryExit</span>
 <span class="k">def</span> <span class="nf">func1</span><span class="p">():</span>
     <span class="k">print</span><span class="p">(</span><span class="s">&quot;inside func1()&quot;</span><span class="p">)</span>
 
 <span class="k">def</span> <span class="nf">func2</span><span class="p">():</span>
     <span class="k">print</span><span class="p">(</span><span class="s">&quot;inside func2()&quot;</span><span class="p">)</span>
 </pre></div>
+</div>
 <p>The <tt class="docutils literal"><span class="pre">&#64;</span></tt> indicates the application of the decorator.</p>
 </div>
 <div class="section" id="function-decorators">
 <h2>Function Decorators<a class="headerlink" href="#function-decorators" title="Permalink to this headline">¶</a></h2>
 <p>A function decorator is applied to a function definition by placing it on the
 line before that function definition begins. For example:</p>
-<div class="highlight"><pre><span class="nd">@myDecorator</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="nd">@myDecorator</span>
 <span class="k">def</span> <span class="nf">aFunction</span><span class="p">():</span>
     <span class="k">print</span><span class="p">(</span><span class="s">&quot;inside aFunction&quot;</span><span class="p">)</span>
 </pre></div>
+</div>
 <p>When the compiler passes over this code, <tt class="docutils literal"><span class="pre">aFunction()</span></tt> is compiled and the
 resulting function object is passed to the <tt class="docutils literal"><span class="pre">myDecorator</span></tt> code, which does
 something to produce a function-like object that is then substituted for the
 <p>What should the decorator do? Well, it can do anything but usually you expect
 the original function code to be used at some point. This is not required,
 however:</p>
-<div class="highlight"><pre><span class="k">class</span> <span class="nc">myDecorator</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">myDecorator</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
 
     <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">f</span><span class="p">):</span>
         <span class="k">print</span><span class="p">(</span><span class="s">&quot;inside myDecorator.__init__()&quot;</span><span class="p">)</span>
 
 <span class="n">aFunction</span><span class="p">()</span>
 </pre></div>
+</div>
 <p>When you run this code, you see:</p>
-<pre>inside myDecorator.__init__()
+<div class="highlight-python"><pre>inside myDecorator.__init__()
 inside aFunction()
 Finished decorating aFunction()
 inside myDecorator.__call__()</pre>
+</div>
 <p>Notice that the constructor for <tt class="docutils literal"><span class="pre">myDecorator</span></tt> is executed at the point of
 decoration of the function. Since we can call <tt class="docutils literal"><span class="pre">f()</span></tt> inside <tt class="docutils literal"><span class="pre">__init__()</span></tt>, it
 shows that the creation of <tt class="docutils literal"><span class="pre">f()</span></tt> is complete before the decorator is called.
 function object with the result of the decoration &#8211; in our case, the
 <tt class="docutils literal"><span class="pre">myDecorator</span></tt> object replaces <tt class="docutils literal"><span class="pre">aFunction</span></tt>. Indeed, before decorators were
 added you had to do something much less elegant to achieve the same thing:</p>
-<div class="highlight"><pre><span class="k">def</span> <span class="nf">foo</span><span class="p">():</span> <span class="k">pass</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">foo</span><span class="p">():</span> <span class="k">pass</span>
 <span class="n">foo</span> <span class="o">=</span> <span class="nb">staticmethod</span><span class="p">(</span><span class="n">foo</span><span class="p">)</span>
 </pre></div>
+</div>
 <p>With the addition of the <tt class="docutils literal"><span class="pre">&#64;</span></tt> decoration operator, you now get the same result
 by saying:</p>
-<div class="highlight"><pre><span class="nd">@staticmethod</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="nd">@staticmethod</span>
 <span class="k">def</span> <span class="nf">foo</span><span class="p">():</span> <span class="k">pass</span>
 </pre></div>
+</div>
 <p>This is the reason why people argued against decorators, because the <tt class="docutils literal"><span class="pre">&#64;</span></tt> is
 just a little syntax sugar meaning &#8220;pass a function object through another
 function and assign the result to the original function.&#8221;</p>
 <h2>Slightly More Useful<a class="headerlink" href="#slightly-more-useful" title="Permalink to this headline">¶</a></h2>
 <p>Now let&#8217;s go back and implement the first example. Here, we&#8217;ll do the more
 typical thing and actually use the code in the decorated functions:</p>
-<div class="highlight"><pre><span class="k">class</span> <span class="nc">entryExit</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">entryExit</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
 
     <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">f</span><span class="p">):</span>
         <span class="bp">self</span><span class="o">.</span><span class="n">f</span> <span class="o">=</span> <span class="n">f</span>
 <span class="n">func1</span><span class="p">()</span>
 <span class="n">func2</span><span class="p">()</span>
 </pre></div>
+</div>
 <p>The output is:</p>
-<pre>Entering func1
+<div class="highlight-python"><pre>Entering func1
 inside func1()
 Exited func1
 Entering func2
 inside func2()
 Exited func2</pre>
+</div>
 <p>You can see that the decorated functions now have the &#8220;Entering&#8221; and &#8220;Exited&#8221;
 trace statements around the call.</p>
 <p>The constructor stores the argument, which is the function object. In the call,
 replaced the original function with an object of a class that has a
 <tt class="docutils literal"><span class="pre">__call__()</span></tt> method. But a function object is also callable, so we can rewrite
 the previous example using a function instead of a class, like this:</p>
-<div class="highlight"><pre><span class="k">def</span> <span class="nf">entryExit</span><span class="p">(</span><span class="n">f</span><span class="p">):</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">entryExit</span><span class="p">(</span><span class="n">f</span><span class="p">):</span>
     <span class="k">def</span> <span class="nf">new_f</span><span class="p">():</span>
         <span class="k">print</span><span class="p">(</span><span class="s">&quot;Entering&quot;</span><span class="p">,</span> <span class="n">f</span><span class="o">.</span><span class="n">__name__</span><span class="p">)</span>
         <span class="n">f</span><span class="p">()</span>
 <span class="n">func2</span><span class="p">()</span>
 <span class="k">print</span><span class="p">(</span><span class="n">func1</span><span class="o">.</span><span class="n">__name__</span><span class="p">)</span>
 </pre></div>
+</div>
 <p><tt class="docutils literal"><span class="pre">new_f()</span></tt> is defined within the body of <tt class="docutils literal"><span class="pre">entryExit()</span></tt>, so it is created and
 returned when <tt class="docutils literal"><span class="pre">entryExit()</span></tt> is called. Note that <tt class="docutils literal"><span class="pre">new_f()</span></tt> is a <em>closure</em>,
 because it captures the actual value of <tt class="docutils literal"><span class="pre">f</span></tt>.</p>
 <tt class="docutils literal"><span class="pre">new_f</span></tt> function has been substituted for the original function during
 decoration. If this is a problem you can change the name of the decorator
 function before you return it:</p>
-<div class="highlight"><pre><span class="k">def</span> <span class="nf">entryExit</span><span class="p">(</span><span class="n">f</span><span class="p">):</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">entryExit</span><span class="p">(</span><span class="n">f</span><span class="p">):</span>
     <span class="k">def</span> <span class="nf">new_f</span><span class="p">():</span>
         <span class="k">print</span><span class="p">(</span><span class="s">&quot;Entering&quot;</span><span class="p">,</span> <span class="n">f</span><span class="o">.</span><span class="n">__name__</span><span class="p">)</span>
         <span class="n">f</span><span class="p">()</span>
     <span class="n">new_f</span><span class="o">.</span><span class="n">__name__</span> <span class="o">=</span> <span class="n">f</span><span class="o">.</span><span class="n">__name__</span>
     <span class="k">return</span> <span class="n">new_f</span>
 </pre></div>
+</div>
 <p>The information you can dynamically get about functions, and the modifications
 you can make to those functions, are quite powerful in Python.</p>
 </div>
 <p>If we create a decorator without arguments, the function to be decorated is
 passed to the constructor, and the <tt class="docutils literal"><span class="pre">__call__()</span></tt> method is called whenever the
 decorated function is invoked:</p>
-<div class="highlight"><pre><span class="k">class</span> <span class="nc">decoratorWithoutArguments</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">decoratorWithoutArguments</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
 
     <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">f</span><span class="p">):</span>
         <span class="sd">&quot;&quot;&quot;</span>
 <span class="n">sayHello</span><span class="p">(</span><span class="s">&quot;a&quot;</span><span class="p">,</span> <span class="s">&quot;different&quot;</span><span class="p">,</span> <span class="s">&quot;set of&quot;</span><span class="p">,</span> <span class="s">&quot;arguments&quot;</span><span class="p">)</span>
 <span class="k">print</span><span class="p">(</span><span class="s">&quot;After second sayHello() call&quot;</span><span class="p">)</span>
 </pre></div>
+</div>
 <p>Any arguments for the decorated function are just passed to <tt class="docutils literal"><span class="pre">__call__()</span></tt>. The
 output is:</p>
-<pre>Inside __init__()
+<div class="highlight-python"><pre>Inside __init__()
 After decoration
 Preparing to call sayHello()
 Inside __call__()
 sayHello arguments: a different set of arguments
 After self.f(*args)
 After second sayHello() call</pre>
+</div>
 <p>Notice that <tt class="docutils literal"><span class="pre">__init__()</span></tt> is the only method called to perform decoration, and
 <tt class="docutils literal"><span class="pre">__call__()</span></tt> is called every time you call the decorated <tt class="docutils literal"><span class="pre">sayHello()</span></tt>.</p>
 </div>
 decorator.</p>
 <p>Let&#8217;s modify the above example to see what happens when we add arguments to the
 decorator:</p>
-<div class="highlight"><pre><span class="k">class</span> <span class="nc">decoratorWithArguments</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">decoratorWithArguments</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
 
     <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">arg1</span><span class="p">,</span> <span class="n">arg2</span><span class="p">,</span> <span class="n">arg3</span><span class="p">):</span>
         <span class="sd">&quot;&quot;&quot;</span>
 <span class="n">sayHello</span><span class="p">(</span><span class="s">&quot;a&quot;</span><span class="p">,</span> <span class="s">&quot;different&quot;</span><span class="p">,</span> <span class="s">&quot;set of&quot;</span><span class="p">,</span> <span class="s">&quot;arguments&quot;</span><span class="p">)</span>
 <span class="k">print</span><span class="p">(</span><span class="s">&quot;after second sayHello() call&quot;</span><span class="p">)</span>
 </pre></div>
+</div>
 <p>From the output, we can see that the behavior changes quite significantly:</p>
-<pre>Inside __init__()
+<div class="highlight-python"><pre>Inside __init__()
 Inside __call__()
 After decoration
 Preparing to call sayHello()
 sayHello arguments: a different set of arguments
 After f(*args)
 after second sayHello() call</pre>
+</div>
 <p>Now the process of decoration calls the constructor and then immediately invokes
 <tt class="docutils literal"><span class="pre">__call__()</span></tt>, which can only take a single argument (the function object) and
 must return the decorated function object that replaces the original. Notice
 <h2>Decorator Functions with Decorator Arguments<a class="headerlink" href="#decorator-functions-with-decorator-arguments" title="Permalink to this headline">¶</a></h2>
 <p>Finally, let&#8217;s look at the more complex decorator function implementation, where
 you have to do everything all at once:</p>
-<div class="highlight"><pre><span class="k">def</span> <span class="nf">decoratorFunctionWithArguments</span><span class="p">(</span><span class="n">arg1</span><span class="p">,</span> <span class="n">arg2</span><span class="p">,</span> <span class="n">arg3</span><span class="p">):</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">decoratorFunctionWithArguments</span><span class="p">(</span><span class="n">arg1</span><span class="p">,</span> <span class="n">arg2</span><span class="p">,</span> <span class="n">arg3</span><span class="p">):</span>
     <span class="k">def</span> <span class="nf">wrap</span><span class="p">(</span><span class="n">f</span><span class="p">):</span>
         <span class="k">print</span><span class="p">(</span><span class="s">&quot;Inside wrap()&quot;</span><span class="p">)</span>
         <span class="k">def</span> <span class="nf">wrapped_f</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">):</span>
 <span class="n">sayHello</span><span class="p">(</span><span class="s">&quot;a&quot;</span><span class="p">,</span> <span class="s">&quot;different&quot;</span><span class="p">,</span> <span class="s">&quot;set of&quot;</span><span class="p">,</span> <span class="s">&quot;arguments&quot;</span><span class="p">)</span>
 <span class="k">print</span><span class="p">(</span><span class="s">&quot;after second sayHello() call&quot;</span><span class="p">)</span>
 </pre></div>
+</div>
 <p>Here&#8217;s the output:</p>
-<pre>Inside wrap()
+<div class="highlight-python"><pre>Inside wrap()
 After decoration
 Preparing to call sayHello()
 Inside wrapped_f()
 sayHello arguments: a different set of arguments
 After f(*args)
 after second sayHello() call</pre>
+</div>
 <p>The return value of the decorator function must be a function used to wrap the
 function to be decorated. That is, Python will take the returned function and
 call it at decoration time, passing the function to be decorated. That&#8217;s why we
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>
 emphasizing the design here (which I want to do) and putting less focus on the
 C-ish nature that <em>can</em> be expressed in Python.</li>
 </ul>
-<pre>The above point is still being debated.</pre>
+<div class="highlight-python"><pre>The above point is still being debated.</pre>
+</div>
 <ul class="simple">
 <li>Four space indents.</li>
 <li>We&#8217;re not using chapter numbers because we&#8217;ll be moving chapters around.
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>

html/TeachingSupport.html

     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>ToDo List &mdash; Python 3 Patterns & Idioms</title>
+    <link rel="stylesheet" href="_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+          URL_ROOT:    '',
+          VERSION:     '1.0',
+          COLLAPSE_MODINDEX: false,
+          FILE_SUFFIX: '.html'
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <link rel="shortcut icon" href="_static/favicon.ico"/>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="top" title="Python 3 Patterns & Idioms" href="index.html" />
+    <link rel="next" title="A Note To Readers" href="NoteToReaders.html" />
+    <link rel="prev" title="Contributors" href="Contributors.html" />
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="NoteToReaders.html" title="A Note To Readers"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="Contributors.html" title="Contributors"
+             accesskey="P">previous</a> |</li>
+        <li><a href="index.html">Python 3 Patterns & Idioms</a> &raquo;</li>
+      </ul>
+    </div>
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  
+  <div class="section" id="todo-list">
+<h1>ToDo List<a class="headerlink" href="#todo-list" title="Permalink to this headline">¶</a></h1>
+<p>Currently, this doesn&#8217;t seem to link into the index, as I&#8217;d hoped.</p>
+<blockquote>
+<ul>
+<li><p class="first">Refine &#8220;Printed Book&#8221; and &#8220;Translations&#8221;</p>
+</li>
+<li><p class="first">Code extractor for rst files (maybe part of intro chapter?)</p>
+</li>
+<li><p class="first">Code updater to put code in/refresh code into book.</p>
+</li>
+<li><p class="first">Move frontmatter into its own directory</p>
+</li>
+<li><p class="first">&lt;!&gt; Seems to be a warning sign (but initial tests didn&#8217;t work)</p>
+</li>
+<li><p class="first">Idea: decorator on a dictionary object, to turn it into an ordered dictionary.</p>
+</li>
+<li><p class="first">&#8220;Other resources&#8221; at the end of each chapter</p>
+</li>
+<li><p class="first">For print version, convert hyperlinks into footnotes.</p>
+<blockquote>
+<ul class="simple">
+<li>build tool for this, or check int rst handling of this - see if it works with Sphinx;</li>
+</ul>
+</blockquote>
+</li>
+</ul>
+</blockquote>
+</div>
+<div class="section" id="the-remainder-are-from-context-from-the-book">
+<h1>The remainder are from context, from the book.<a class="headerlink" href="#the-remainder-are-from-context-from-the-book" title="Permalink to this headline">¶</a></h1>
+<div class="admonition-todo admonition ">
+<p class="first admonition-title">Todo</p>
+<p>Yarko (example label of ToDo):</p>
+<ul class="last simple">
+<li>update CSS styles for todo&#8217;s &amp; todo lists;</li>
+<li>look at <a class="reference external" href="http://sphinx.pocoo.org/ext/coverage.html">http://sphinx.pocoo.org/ext/coverage.html</a> for example.</li>
+<li>Autogenerated ToDoLists do not appear in LaTeX output - debug, fix;</li>
+<li>DONE:
+- ToDo does not appear to be created by make dependencies (it&#8217;s autogenerated);
+- update Makefile to always re-generate todo lists;</li>
+</ul>
+</div>
+<p>(The original entry is located in Contributors.rst, line 27 and can be found <a class="reference external" href="Contributors.html#todo-2"><em>here</em></a>.)</p>
+<div class="admonition-todo admonition ">
+<p class="first admonition-title">Todo</p>
+<p class="last">The remainder of this document needs rewriting. Rewrite this section for BitBucket &amp; Mercurial; make some project specific diagrams;</p>
+</div>
+<p>(The original entry is located in DeveloperGuide.rst, line 135 and can be found <a class="reference external" href="DeveloperGuide.html#todo-4"><em>here</em></a>.)</p>
+<div class="admonition-todo admonition ">
+<p class="first admonition-title">Todo</p>
+<p>This section still work in progress:</p>
+<ul class="last simple">
+<li><tt class="docutils literal"><span class="pre">hg</span> <span class="pre">branch</span> <span class="pre">lp:python3patterns</span></tt></li>
+<li><tt class="docutils literal"><span class="pre">hg</span> <span class="pre">commit</span> <span class="pre">-m</span> <span class="pre">'initial</span> <span class="pre">checkout'</span></tt></li>
+<li>(hack, hack, hack....)</li>
+<li><tt class="docutils literal"><span class="pre">hg</span> <span class="pre">merge</span></tt>   (pull new updates)</li>
+<li><tt class="docutils literal"><span class="pre">hg</span> <span class="pre">commit</span> <span class="pre">-m</span> <span class="pre">'checkin</span> <span class="pre">after</span> <span class="pre">merge...'</span></tt></li>
+<li>... and so on...</li>
+</ul>
+</div>
+<p>(The original entry is located in DeveloperGuide.rst, line 154 and can be found <a class="reference external" href="DeveloperGuide.html#todo-5"><em>here</em></a>.)</p>
+</div>
+
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+            <p class="logo"><a href="index.html">
+              <img class="logo" src="_static/Logo.png" alt="Logo"/>
+            </a></p>
+    <font color="Red">This book is in early development; you will find parts that are incorrect &amp; incomplete.</font>
+    
+            <h3><a href="index.html">Table Of Contents</a></h3>
+            <ul>
+<li><a class="reference external" href="">ToDo List</a></li>
+<li><a class="reference external" href="#the-remainder-are-from-context-from-the-book">The remainder are from context, from the book.</a></li>
+</ul>
+
+
+            <h4>Previous topic</h4>
+            <p class="topless"><a href="Contributors.html" title="previous chapter">Contributors</a></p>
+            <h4>Next topic</h4>
+            <p class="topless"><a href="NoteToReaders.html" title="next chapter">A Note To Readers</a></p>
+            <h3>This Page</h3>
+            <ul class="this-page-menu">
+              <li><a href="_sources/ToDo.txt">Show Source</a></li>
+            </ul>
+    
+          <h3>Quick search</h3>
+            <form class="search" action="search.html" method="get">
+              <input type="text" name="q" size="18" /> <input type="submit" value="Go" />
+              <input type="hidden" name="check_keywords" value="yes" />
+              <input type="hidden" name="area" value="default" />
+            </form>
+    <h4><a href="http://www.mindviewinc.com/Books/Python3Patterns/Index.php">Project Homepage</a></h4>
+    <h4><a href="http://www.bitbucket.org/BruceEckel/python-3-patterns-idioms/issues/">Corrections/Suggestions</a></h4>
+    <h4><a href="http://www.mindviewinc.com/Consulting/Index.php">Consulting &amp; Training</a></h4><br><br>
+
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="NoteToReaders.html" title="A Note To Readers"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="Contributors.html" title="Contributors"
+             accesskey="P">previous</a> |</li>
+        <li><a href="index.html">Python 3 Patterns & Idioms</a> &raquo;</li>
+      </ul>
+    </div>
+    <div class="footer">
+      &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
+      Last updated on Nov 11, 2008.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
+    </div>
+  </body>
+</html>

html/_sources/Contributors.txt

 
   * And of course, Guido and the team for their incessant improvement of Python,
     especially for taking the risk in breaking backward compatibility in Python
-    3.0 to refactor the language.
+    3.0 to refactor the language.
+ 
+
+===============================================================================
+
+.. todo:: Yarko (example label of ToDo):
+
+    - update CSS styles for todo's & todo lists;
+    - look at http://sphinx.pocoo.org/ext/coverage.html for example.
+    - Autogenerated ToDoLists do not appear in LaTeX output - debug, fix;
+    - DONE:
+      - ToDo does not appear to be created by make dependencies (it's autogenerated);
+      - update Makefile to always re-generate todo lists;
+     
+
+

html/_sources/DeveloperGuide.txt

 
 to see the options.
 
+.. todo:: The remainder of this document needs rewriting. Rewrite this section for BitBucket & Mercurial; make some project specific diagrams;
 Working with BitBucket and Mercurial
+
 ===============================================================================
 
-.. note::   The remainder of this document needs rewriting.
+.. note:: Adapted from a posting by Yarko Tymciurak
 
-(Adapted from a posting by Yarko T)
 
 This assumes that you have created a local branch on your private machine where
 you do work, and keep it merged with the trunk.
 
 That is, you've done:
 
+   - Forked a branch of http://www.bitbucket.org/BruceEckel/python-3-patterns-idioms/ (the main trunk; this fork will provide a place for review and comment)
+   - cloned the trunk to your local machine:
+     - hg clone https://my_login@bitbucket.org/BruceEckel/python-3-patterns-idioms/
+   - cloned your local copy of trunk to create a working directory:
+     - hg clone python-3-patterns-idioms devel
+
+.. ToDo:: This section still work in progress:
+
    - ``hg branch lp:python3patterns``
    - ``hg commit -m 'initial checkout'``
    - (hack, hack, hack....)
 
 When you are ready to share your work have others review, register a branch.
 
-.. note:: Once you create a branch, there is no easy way to remove it.
 
 .. note:: You can re-use one branch for multiple bug fixes.
 

html/_sources/ToDo.txt

+
+ToDo List
+---------
+
+Currently, this doesn't seem to link into the index, as I'd hoped.
+
+
+   - Refine "Printed Book" and "Translations"
+   - Code extractor for rst files (maybe part of intro chapter?)
+   - Code updater to put code in/refresh code into book.
+
+   - Move frontmatter into its own directory
+
+   - <!> Seems to be a warning sign (but initial tests didn't work)
+
+   - Idea: decorator on a dictionary object, to turn it into an ordered dictionary.
+
+   - "Other resources" at the end of each chapter
+
+   - For print version, convert hyperlinks into footnotes.
+
+       - build tool for this, or check int rst handling of this - see if it works with Sphinx;
+
+
+
+The remainder are from context, from the book.
+--------------------------------------------------------------------------------
+
+.. todolist::
+

html/_sources/index.txt

 
 .. toctree::
 
-   Contributors.rst
-   NoteToReaders.rst
-   Introduction.rst
-   TeachingSupport.rst
-   Rules.rst
-   DeveloperGuide.rst
-   Part1.rst
-   quickPython.rst
-   unitTesting.rst
-   LanguageChanges.rst
-   PythonDecorators.rst
-   GeneratorsIterators.rst
-   Comprehensions.rst
-   CoroutinesAndConcurrency.rst
-   jython.rst
-   Part2.rst
-   MachineDiscovery.rst
-   CanonicalScript.rst
-   Part3.rst
-   patternConcept.rst
-   singleton.rst
-   appFrameworks.rst
-   fronting.rst
-   stateMachine.rst
-   decorator.rst
-   iterators.rst
-   factory.rst
-   functionObjects.rst
-   changeInterface.rst
-   tableDriven.rst
-   observer.rst
-   multipleDispatching.rst
-   visitor.rst
-   patternRefactoring.rst
-   projects.rst
+   Contributors
+   ToDo
+   NoteToReaders
+   Introduction
+   TeachingSupport
+   Rules
+   DeveloperGuide
+   Part1
+   quickPython
+   unitTesting
+   LanguageChanges
+   PythonDecorators
+   GeneratorsIterators
+   Comprehensions
+   CoroutinesAndConcurrency
+   jython
+   Part2
+   MachineDiscovery
+   CanonicalScript
+   Part3
+   patternConcept
+   singleton
+   appFrameworks
+   fronting
+   stateMachine
+   decorator
+   iterators
+   factory
+   functionObjects
+   changeInterface
+   tableDriven
+   observer
+   multipleDispatching
+   visitor
+   patternRefactoring
+   projects
 
 Indices and tables
 ==================

html/_static/LaunchpadBrand.pdf

Binary file added.

html/_static/LaunchpadLogo.pdf

Binary file added.

html/_static/Logo.pdf

Binary file added.

html/_static/default.css

     font-weight: bold;
 }
 
+/* Sidebars */
+
+div.sidebar {
+    margin: 0 0 0.5em 1em;
+    border: 1px solid #ddb;
+    padding: 7px 7px 0 7px;
+    background-color: #ffe;
+    width: 40%;
+    float: right;
+}
+
+p.sidebar-title {
+    font-weight: bold;
+}
+
 /* "Topics" */
 
 div.topic {
     background-color: #eee;
     border: 1px solid #ccc;
-    padding: 0 7px 0 7px;
+    padding: 7px 7px 0 7px;
     margin: 10px 0 10px 0;
 }
 
     margin-bottom: 0;
 }
 
-div.admonition p {
+div.admonition p.admonition-title + p {
     display: inline;
 }
 

html/_static/sphinxdoc.css

     font-weight: bold;
 }
 
+div.sidebar {
+    margin: 0 0 0.5em 1em;
+    border: 1px solid #ddb;
+    padding: 7px 7px 0 7px;
+    background-color: #ffe;
+    width: 40%;
+    float: right;
+}
+
+p.sidebar-title {
+    font-weight: bold;
+}
+
+div.topic {
+    background-color: #f8f8f8;
+    border: 1px solid #ccc;
+    padding: 7px 7px 0 7px;
+    margin: 10px 0 10px 0;
+}
+
+p.topic-title {
+    font-size: 1.1em;
+    font-weight: bold;
+}
+
 h1 {
     margin: 0;
     padding: 0.7em 0 0.3em 0;

html/appFrameworks.html

 override) in order to do its job, but it is usually called only as part of an
 initialization process (and thus the client programmer isn&#8217;t necessarily able to
 call it directly):</p>
-<div class="highlight"><pre><span class="c"># appFrameworks/TemplateMethod.py</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="c"># appFrameworks/TemplateMethod.py</span>
 <span class="c"># Simple demonstration of Template Method.</span>
 
 <span class="k">class</span> <span class="nc">ApplicationFramework</span><span class="p">:</span>
 
 <span class="n">MyApp</span><span class="p">()</span>
 </pre></div>
+</div>
 <p>The base-class constructor is responsible for performing the necessary
 initialization and then starting the &#8220;engine&#8221; (the template method) that runs
 the application (in a GUI application, this &#8220;engine&#8221; would be the main event
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>

html/changeInterface.html

 <p>When you&#8217;ve got <em>this</em>, and you need <em>that</em>, <em>Adapter</em> solves the problem. The
 only requirement is to produce a <em>that</em>, and there are a number of ways you can
 accomplish this adaptation:</p>
-<div class="highlight"><pre><span class="c"># changeInterface/Adapter.py</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="c"># changeInterface/Adapter.py</span>
 <span class="c"># Variations on the Adapter pattern.</span>
 
 <span class="k">class</span> <span class="nc">WhatIHave</span><span class="p">:</span>
 <span class="c"># Approach 4:</span>
 <span class="n">whatIUse</span><span class="o">.</span><span class="n">op</span><span class="p">(</span><span class="n">whatIHave3</span><span class="o">.</span><span class="n">whatIWant</span><span class="p">())</span>
 </pre></div>
+</div>
 <p>I&#8217;m taking liberties with the term &#8220;proxy&#8221; here, because in <em>Design Patterns</em>
 they assert that a proxy must have an identical interface with the object that
 it is a surrogate for. However, if you have the two words together: &#8220;proxy
 <p>Façade is often implemented as singleton abstract factory. Of course, you can
 easily get this effect by creating a class containing <strong>static</strong> factory
 methods:</p>
-<div class="highlight"><pre><span class="c"># changeInterface/Facade.py</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="c"># changeInterface/Facade.py</span>
 <span class="k">class</span> <span class="nc">A</span><span class="p">:</span>
     <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">):</span> <span class="k">pass</span>
 <span class="k">class</span> <span class="nc">B</span><span class="p">:</span>
 <span class="n">b</span> <span class="o">=</span> <span class="n">Facade</span><span class="o">.</span><span class="n">makeB</span><span class="p">(</span><span class="mf">1</span><span class="p">);</span>
 <span class="n">c</span> <span class="o">=</span> <span class="n">Facade</span><span class="o">.</span><span class="n">makeC</span><span class="p">(</span><span class="mf">1.0</span><span class="p">);</span>
 </pre></div>
+</div>
 <p>[rewrite this section using research from Larman&#8217;s book]</p>
 <p>Example for Facade (?): my &#8220;nicer&#8221; version of the XML library.</p>
 </div>
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>

html/decorator.html

 <p>The key to using this method is to find the particular combination you want.
 So, once you&#8217;ve found the drink you would like, here is how you would use it, as
 shown in the <strong>CoffeeShop</strong> class in the following code:</p>
-<div class="highlight"><pre><span class="c"># decorator/nodecorators/CoffeeShop.py</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="c"># decorator/nodecorators/CoffeeShop.py</span>
 <span class="c"># Coffee example with no decorators</span>
 
 <span class="k">class</span> <span class="nc">Espresso</span><span class="p">:</span> <span class="k">pass</span>
 <span class="k">print</span><span class="p">((</span><span class="n">cafeMocha</span><span class="o">.</span><span class="n">getDescription</span><span class="p">()</span>
   <span class="o">+</span> <span class="s">&quot;: $&quot;</span> <span class="o">+</span> <span class="sb">`cafeMocha.getCost()`</span><span class="p">))</span>
 </pre></div>
+</div>
 <p>And here is the corresponding output:</p>
-<pre>Cappucino: $1.0
+<div class="highlight-python"><pre>Cappucino: $1.0
 Cafe Mocha decaf whipped cream: $1.25</pre>
+</div>
 <p>You can see that creating the particular combination you want is easy, since you
 are just creating an instance of a class. However, there are a number of
 problems with this approach. Firstly, the combinations are fixed statically so
 and can of course perform processing before or after the invocation.</p>
 <p>So if we added <strong>getTotalCost()</strong> and <strong>getDescription()</strong> methods to the
 <strong>DrinkComponent</strong> interface, an Espresso looks like this:</p>
-<pre># decorator/alldecorators/EspressoDecorator.py
+<div class="highlight-python"><pre># decorator/alldecorators/EspressoDecorator.py
 
 class Espresso(Decorator):
     cost = 0.75f
     def getDescription(self):
         return self.component.getDescription() +
             description</pre>
+</div>
 <p>You combine the components to create a drink as follows, as shown in the code
 below:</p>
-<pre># decorator/alldecorators/CoffeeShop.py
+<div class="highlight-python"><pre># decorator/alldecorators/CoffeeShop.py
 # Coffee example using decorators
 
 class DrinkComponent:
 
 print(cafeMocha.getDescription().strip() + \)
   ": $" + `cafeMocha.getTotalCost()`</pre>
+</div>
 <p>This approach would certainly provide the most flexibility and the smallest
 menu. You have a small number of components to choose from, but assembling the
 description of the coffee then becomes rather arduous.</p>
 <p>If you want to describe a plain cappuccino, you create it with:</p>
-<div class="highlight"><pre><span class="n">plainCap</span> <span class="o">=</span> <span class="n">Espresso</span><span class="p">(</span><span class="n">FoamedMilk</span><span class="p">(</span><span class="n">Mug</span><span class="p">()))</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="n">plainCap</span> <span class="o">=</span> <span class="n">Espresso</span><span class="p">(</span><span class="n">FoamedMilk</span><span class="p">(</span><span class="n">Mug</span><span class="p">()))</span>
 </pre></div>
+</div>
 <p>Creating a decaf Cafe Mocha with whipped cream requires an even longer
 description.</p>
 </div>
 are presented with in most coffee shops.</p>
 <img alt="_images/compromiseDecoration.gif" src="_images/compromiseDecoration.gif" />
 <p>Here is how to create a basic selection, as well as a decorated selection:</p>
-<pre># decorator/compromise/CoffeeShop.py
+<div class="highlight-python"><pre># decorator/compromise/CoffeeShop.py
 # Coffee example with a compromise of basic
 # combinations and decorators
 
 cafeMocha = Whipped(Decaf(CafeMocha()))
 print(cafeMocha.getDescription() + ": $" + \)
   `cafeMocha.getTotalCost()`</pre>
+</div>
 <p>You can see that creating a basic selection is quick and easy, which makes sense
 since they will be described regularly.  Describing a decorated drink is more
 work than when using a class per combination, but clearly less work than when
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>

html/factory.html

 <h2>Simple Factory Method<a class="headerlink" href="#simple-factory-method" title="Permalink to this headline">¶</a></h2>
 <p>As an example, let&#8217;s revisit the <strong>Shape</strong> system.</p>
 <p>One approach is to make the factory a <strong>static</strong> method of the base class:</p>
-<div class="highlight"><pre><span class="c"># factory/shapefact1/ShapeFactory1.py</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="c"># factory/shapefact1/ShapeFactory1.py</span>
 <span class="c"># A simple static factory method.</span>
 <span class="kn">from</span> <span class="nn">__future__</span> <span class="kn">import</span> <span class="n">generators</span>
 <span class="kn">import</span> <span class="nn">random</span>
     <span class="n">shape</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
     <span class="n">shape</span><span class="o">.</span><span class="n">erase</span><span class="p">()</span>
 </pre></div>
+</div>
 <p>The <strong>factory( )</strong> takes an argument that allows it to determine what type of
 <strong>Shape</strong> to create; it happens to be a <strong>String</strong> in this case but it could be
 any set of data. The <strong>factory( )</strong> is now the only other code in the system
 generator has some kind of internal algorithm that tells it what and how to
 build. It &#8220;generates out of thin air&#8221; rather than being told what to create.</p>
 <p>Now, this may not look consistent with the code you see above:</p>
-<pre>for i in shapeNameGen(7)</pre>
+<div class="highlight-python"><pre>for i in shapeNameGen(7)</pre>
+</div>
 <p>looks like there&#8217;s an initialization taking place. This is where a generator is
 a bit strange - when you call a function that contains a <strong>yield</strong> statement
 (<strong>yield</strong> is a new keyword that determines that a function is a generator),
 <p>Thus, the code that you write is actually a kind of factory, that creates the
 generator objects that do the actual generation. You can use the generator
 explicitly if you want, for example:</p>
-<div class="highlight"><pre><span class="n">gen</span> <span class="o">=</span> <span class="n">shapeNameGen</span><span class="p">(</span><span class="mf">7</span><span class="p">)</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="n">gen</span> <span class="o">=</span> <span class="n">shapeNameGen</span><span class="p">(</span><span class="mf">7</span><span class="p">)</span>
 <span class="k">print</span><span class="p">(</span><span class="n">gen</span><span class="o">.</span><span class="n">next</span><span class="p">())</span>
 </pre></div>
+</div>
 <p>So <strong>next( )</strong> is the iterator method that&#8217;s actually called to generate the
 next object, and it takes no arguments. <strong>shapeNameGen( )</strong> is the factory, and
 <strong>gen</strong> is the generator.</p>
 the list generated by <strong>__subclasses__( )</strong>. If you need to create a deeper
 hierarchy this way, you must recurse the <strong>__subclasses__( )</strong> list.</p>
 <p>Also note that in <strong>shapeNameGen( )</strong> the statement:</p>
-<div class="highlight"><pre><span class="n">types</span> <span class="o">=</span> <span class="n">Shape</span><span class="o">.</span><span class="n">__subclasses__</span><span class="p">()</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="n">types</span> <span class="o">=</span> <span class="n">Shape</span><span class="o">.</span><span class="n">__subclasses__</span><span class="p">()</span>
 </pre></div>
+</div>
 <p>Is only executed when the generator object is produced; each time the <strong>next(
 )</strong> method of this generator object is called (which, as noted above, may happen
 implicitly), only the code in the <strong>for</strong> loop will be executed, so you don&#8217;t
 <h3>Preventing direct creation<a class="headerlink" href="#preventing-direct-creation" title="Permalink to this headline">¶</a></h3>
 <p>To disallow direct access to the classes, you can nest the classes within the
 factory method, like this:</p>
-<div class="highlight"><pre><span class="c"># factory/shapefact1/NestedShapeFactory.py</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="c"># factory/shapefact1/NestedShapeFactory.py</span>
 <span class="kn">import</span> <span class="nn">random</span>
 
 <span class="k">class</span> <span class="nc">Shape</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
 </pre></div>
 </div>
 </div>
+</div>
 <div class="section" id="polymorphic-factories">
 <h2>Polymorphic Factories<a class="headerlink" href="#polymorphic-factories" title="Permalink to this headline">¶</a></h2>
 <p>The static <strong>factory( )</strong> method in the previous example forces all the creation
 example of this in the next section). Here is <strong>ShapeFactory1.py</strong> modified so
 the factory methods are in a separate class as virtual functions. Notice also
 that the specific <strong>Shape</strong> classes are dynamically loaded on demand:</p>
-<div class="highlight"><pre><span class="c"># factory/shapefact2/ShapeFactory2.py</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="c"># factory/shapefact2/ShapeFactory2.py</span>
 <span class="c"># Polymorphic factory methods.</span>
 <span class="kn">from</span> <span class="nn">__future__</span> <span class="kn">import</span> <span class="n">generators</span>
 <span class="kn">import</span> <span class="nn">random</span>
     <span class="n">shape</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
     <span class="n">shape</span><span class="o">.</span><span class="n">erase</span><span class="p">()</span>
 </pre></div>
+</div>
 <p>Now the factory method appears in its own class, <strong>ShapeFactory</strong>, as the
 <strong>create( )</strong> method. The different types of shapes must each create their own
 factory with a <strong>create( )</strong> method to create an object of their own type. The
 <p>As another example suppose you are creating a general-purpose gaming environment
 and you want to be able to support different types of games. Here&#8217;s how it might
 look using an abstract factory:</p>
-<div class="highlight"><pre><span class="c"># factory/Games.py</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="c"># factory/Games.py</span>
 <span class="c"># An example of the Abstract Factory pattern.</span>
 
 <span class="k">class</span> <span class="nc">Obstacle</span><span class="p">:</span>
 <span class="n">g1</span><span class="o">.</span><span class="n">play</span><span class="p">()</span>
 <span class="n">g2</span><span class="o">.</span><span class="n">play</span><span class="p">()</span>
 </pre></div>
+</div>
 <p>In this environment, <strong>Character</strong> objects interact with <strong>Obstacle</strong> objects,
 but there are different types of Characters and obstacles depending on what kind
 of game you&#8217;re playing. You determine the kind of game by choosing a particular
 example) is unnecessary - it&#8217;s only required for languages that have static type
 checking. As long as the concrete Python classes follow the form of the required
 classes, we don&#8217;t need any base classes:</p>
-<div class="highlight"><pre><span class="c"># factory/Games2.py</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="c"># factory/Games2.py</span>
 <span class="c"># Simplified Abstract Factory.</span>
 
 <span class="k">class</span> <span class="nc">Kitty</span><span class="p">:</span>
 <span class="n">g1</span><span class="o">.</span><span class="n">play</span><span class="p">()</span>
 <span class="n">g2</span><span class="o">.</span><span class="n">play</span><span class="p">()</span>
 </pre></div>
+</div>
 <p>Another way to put this is that all inheritance in Python is implementation
 inheritance; since Python does its type-checking at runtime, there&#8217;s no need to
 use interface inheritance so that you can upcast to the base type.</p>
 <p>You might want to study the two examples for comparison, however. Does the first
 one add enough useful information about the pattern that it&#8217;s worth keeping some
 aspect of it? Perhaps all you need is &#8220;tagging classes&#8221; like this:</p>
-<div class="highlight"><pre><span class="k">class</span> <span class="nc">Obstacle</span><span class="p">:</span> <span class="k">pass</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">Obstacle</span><span class="p">:</span> <span class="k">pass</span>
 <span class="k">class</span> <span class="nc">Character</span><span class="p">:</span> <span class="k">pass</span>
 <span class="k">class</span> <span class="nc">GameElementFactory</span><span class="p">:</span> <span class="k">pass</span>
 </pre></div>
+</div>
 <p>Then the inheritance serves only to indicate the type of the derived classes.</p>
 </div>
 <div class="section" id="exercises">
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>

html/fronting.html

 <div class="section" id="proxy">
 <h2>Proxy<a class="headerlink" href="#proxy" title="Permalink to this headline">¶</a></h2>
 <p>If we implement <em>Proxy</em> by following the above diagram, it looks like this:</p>
-<div class="highlight"><pre><span class="c"># fronting/ProxyDemo.py</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="c"># fronting/ProxyDemo.py</span>
 <span class="c"># Simple demonstration of the Proxy pattern.</span>
 
 <span class="k">class</span> <span class="nc">Implementation</span><span class="p">:</span>
 <span class="n">p</span> <span class="o">=</span> <span class="n">Proxy</span><span class="p">()</span>
 <span class="n">p</span><span class="o">.</span><span class="n">f</span><span class="p">();</span> <span class="n">p</span><span class="o">.</span><span class="n">g</span><span class="p">();</span> <span class="n">p</span><span class="o">.</span><span class="n">h</span><span class="p">()</span>
 </pre></div>
+</div>
 <p>It isn&#8217;t necessary that <strong>Implementation</strong> have the same interface as <strong>Proxy</strong>;
 as long as <strong>Proxy</strong> is somehow &#8220;speaking for&#8221; the class that it is referring
 method calls to then the basic idea is satisfied (note that this statement is at
 that <strong>Proxy</strong> needs to call.</p>
 <p>Of course, in Python we have a delegation mechanism built in, so it makes the
 <strong>Proxy</strong> even simpler to implement:</p>
-<div class="highlight"><pre><span class="c"># fronting/ProxyDemo2.py</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="c"># fronting/ProxyDemo2.py</span>
 <span class="c"># Simple demonstration of the Proxy pattern.</span>
 
 <span class="k">class</span> <span class="nc">Implementation2</span><span class="p">:</span>
 <span class="n">p</span> <span class="o">=</span> <span class="n">Proxy2</span><span class="p">()</span>
 <span class="n">p</span><span class="o">.</span><span class="n">f</span><span class="p">();</span> <span class="n">p</span><span class="o">.</span><span class="n">g</span><span class="p">();</span> <span class="n">p</span><span class="o">.</span><span class="n">h</span><span class="p">();</span>
 </pre></div>
+</div>
 <p>The beauty of using <strong>__getattr__( )</strong> is that <strong>Proxy2</strong> is completely generic,
 and not tied to any particular implementation (in Java, a rather complicated
 &#8220;dynamic proxy&#8221; has been invented to accomplish this same thing).</p>
 <h2>State<a class="headerlink" href="#state" title="Permalink to this headline">¶</a></h2>
 <p>The <em>State</em> pattern adds more implementations to <em>Proxy</em>, along with a way to
 switch from one implementation to another during the lifetime of the surrogate:</p>
-<div class="highlight"><pre><span class="c"># fronting/StateDemo.py</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="c"># fronting/StateDemo.py</span>
 <span class="c"># Simple demonstration of the State pattern.</span>
 
 <span class="k">class</span> <span class="nc">State_d</span><span class="p">:</span>
 <span class="n">b</span><span class="o">.</span><span class="n">changeImp</span><span class="p">(</span><span class="n">Implementation2</span><span class="p">())</span>
 <span class="n">run</span><span class="p">(</span><span class="n">b</span><span class="p">)</span>
 </pre></div>
+</div>
 <p>You can see that the first implementation is used for a bit, then the second
 implementation is swapped in and that is used.</p>
 <p>The difference between <em>Proxy</em> and <em>State</em> is in the problems that are solved.
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>

html/functionObjects.html

 wrapping a method in an object, you can pass it to other methods or objects as a
 parameter, to tell them to perform this particular operation in the process of
 fulfilling your request:</p>
-<div class="highlight"><pre><span class="c"># functionObjects/CommandPattern.py</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="c"># functionObjects/CommandPattern.py</span>
 
 <span class="k">class</span> <span class="nc">Command</span><span class="p">:</span>
     <span class="k">def</span> <span class="nf">execute</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="k">pass</span>
 <span class="n">macro</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">Afford</span><span class="p">())</span>
 <span class="n">macro</span><span class="o">.</span><span class="n">run</span><span class="p">()</span>
 </pre></div>
+</div>
 <p>The primary point of <em>Command</em> is to allow you to hand a desired action to a
 method or object. In the above example, this provides a way to queue a set of
 actions to be performed collectively. In this case, it allows you to dynamically
 <p><em>Strategy</em> also adds a &#8220;Context&#8221; which can be a surrogate class that controls
 the selection and use of the particular strategy object-just like <em>State</em>!
 Here&#8217;s what it looks like:</p>
-<div class="highlight"><pre><span class="c"># functionObjects/StrategyPattern.py</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="c"># functionObjects/StrategyPattern.py</span>
 
 <span class="c"># The strategy interface:</span>
 <span class="k">class</span> <span class="nc">FindMinima</span><span class="p">:</span>
 <span class="n">solver</span><span class="o">.</span><span class="n">changeAlgorithm</span><span class="p">(</span><span class="n">Bisection</span><span class="p">())</span>
 <span class="k">print</span><span class="p">(</span><span class="n">solver</span><span class="o">.</span><span class="n">minima</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
 </pre></div>
+</div>
 <p>Note similarity with template method - TM claims distinction that it has more
 than one method to call, does things piecewise. However, it&#8217;s not unlikely that
 strategy object would have more than one method call; consider Shalloway&#8217;s order
 find a solution. <em>Chain of Responsibility</em> provides a way to do this by chaining
 the <em>Strategy</em> objects together and providing a mechanism for them to
 automatically recurse through each one in the chain:</p>
-<div class="highlight"><pre><span class="c"># functionObjects/ChainOfResponsibility.py</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="c"># functionObjects/ChainOfResponsibility.py</span>
 
 <span class="c"># Carry the information into the strategy:</span>
 <span class="k">class</span> <span class="nc">Messenger</span><span class="p">:</span> <span class="k">pass</span>
 <span class="k">print</span><span class="p">(</span><span class="n">solutions</span><span class="p">[</span><span class="mf">0</span><span class="p">](</span><span class="n">line</span><span class="p">))</span>
 </pre></div>
 </div>
+</div>
 <div class="section" id="exercises">
 <h2>Exercises<a class="headerlink" href="#exercises" title="Permalink to this headline">¶</a></h2>
 <ol class="arabic simple">
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>

html/genindex.html

 <table width="100%" class="indextable"><tr><td width="33%" valign="top">
 <dl>
 
-<dt><a href="PythonDecorators.html#index-5">@: Python decorators</a>, <a href="_test/PythonDecorators.html#index-12">[1]</a></dt></dl></td><td width="33%" valign="top"><dl>
+<dt><a href="PythonDecorators.html#index-8">@: Python decorators</a></dt></dl></td><td width="33%" valign="top"><dl>
 </dl></td></tr></table>
 
 <h2 id="C">C</h2>
 
 <dt>canonical form</dt>
   <dd><dl>
-    <dt><a href="CanonicalScript.html#index-0">script command-line</a>, <a href="_test/CanonicalScript.html#index-7">[1]</a></dt>
+    <dt><a href="CanonicalScript.html#index-0">script command-line</a></dt>
   </dl></dd>
 <dt>command-line</dt>
   <dd><dl>
-    <dt><a href="CanonicalScript.html#index-0">canonical form, script</a>, <a href="_test/CanonicalScript.html#index-7">[1]</a></dt>
+    <dt><a href="CanonicalScript.html#index-0">canonical form, script</a></dt>
   </dl></dd>
 <dt>comprehension</dt>
   <dd><dl>
-    <dt><a href="Comprehensions.html#index-1">generator</a>, <a href="_test/Comprehensions.html#index-8">[1]</a></dt>
-    <dt><a href="Comprehensions.html#index-1">list</a>, <a href="_test/Comprehensions.html#index-8">[1]</a></dt>
+    <dt><a href="Comprehensions.html#index-1">generator</a></dt>
+    <dt><a href="Comprehensions.html#index-1">list</a></dt>
   </dl></dd></dl></td><td width="33%" valign="top"><dl>
-<dt><a href="CoroutinesAndConcurrency.html#index-6">concurrency</a>, <a href="_test/CoroutinesAndConcurrency.html#index-9">[1]</a></dt>
-<dt><a href="CoroutinesAndConcurrency.html#index-6">coroutines</a>, <a href="_test/CoroutinesAndConcurrency.html#index-9">[1]</a></dt>
+<dt><a href="CoroutinesAndConcurrency.html#index-3">concurrency</a></dt>
+<dt><a href="CoroutinesAndConcurrency.html#index-3">coroutines</a></dt>
 </dl></td></tr></table>
 
 <h2 id="D">D</h2>
 <table width="100%" class="indextable"><tr><td width="33%" valign="top">
 <dl>
 
-<dt><a href="PythonDecorators.html#index-5">decorator: Python decorators</a>, <a href="_test/PythonDecorators.html#index-12">[1]</a></dt></dl></td><td width="33%" valign="top"><dl>
+<dt><a href="PythonDecorators.html#index-8">decorator: Python decorators</a></dt></dl></td><td width="33%" valign="top"><dl>
 </dl></td></tr></table>
 
 <h2 id="G">G</h2>
 
 <dt>generator</dt>
   <dd><dl>
-    <dt><a href="Comprehensions.html#index-1">comprehension</a>, <a href="_test/Comprehensions.html#index-8">[1]</a></dt>
+    <dt><a href="Comprehensions.html#index-1">comprehension</a></dt>
   </dl></dd>
-<dt><a href="GeneratorsIterators.html#index-3">generators</a>, <a href="_test/GeneratorsIterators.html#index-10">[1]</a></dt></dl></td><td width="33%" valign="top"><dl>
-<dt><a href="CoroutinesAndConcurrency.html#index-6">GIL: Global Interpreter Lock</a>, <a href="_test/CoroutinesAndConcurrency.html#index-9">[1]</a></dt>
+<dt><a href="GeneratorsIterators.html#index-6">generators</a></dt></dl></td><td width="33%" valign="top"><dl>
+<dt><a href="CoroutinesAndConcurrency.html#index-3">GIL: Global Interpreter Lock</a></dt>
 </dl></td></tr></table>
 
 <h2 id="I">I</h2>
 <table width="100%" class="indextable"><tr><td width="33%" valign="top">
 <dl>
 
-<dt><a href="GeneratorsIterators.html#index-3">iterators</a>, <a href="_test/GeneratorsIterators.html#index-10">[1]</a></dt>
-<dt><a href="GeneratorsIterators.html#index-3">itertools</a>, <a href="_test/GeneratorsIterators.html#index-10">[1]</a></dt></dl></td><td width="33%" valign="top"><dl>
+<dt><a href="GeneratorsIterators.html#index-6">iterators</a></dt>
+<dt><a href="GeneratorsIterators.html#index-6">itertools</a></dt></dl></td><td width="33%" valign="top"><dl>
 </dl></td></tr></table>
 
 <h2 id="L">L</h2>
 
 <dt>Language differences</dt>
   <dd><dl>
-    <dt><a href="_test/LanguageChanges.html#index-11">Python 3</a>, <a href="LanguageChanges.html#index-4">[1]</a></dt>
+    <dt><a href="LanguageChanges.html#index-7">Python 3</a></dt>
   </dl></dd>
 <dt>list</dt>
   <dd><dl>
-    <dt><a href="Comprehensions.html#index-1">comprehension</a>, <a href="_test/Comprehensions.html#index-8">[1]</a></dt>
+    <dt><a href="Comprehensions.html#index-1">comprehension</a></dt>
   </dl></dd></dl></td><td width="33%" valign="top"><dl>
 </dl></td></tr></table>
 
 <table width="100%" class="indextable"><tr><td width="33%" valign="top">
 <dl>
 
-<dt><a href="CoroutinesAndConcurrency.html#index-6">multiprocessing</a>, <a href="_test/CoroutinesAndConcurrency.html#index-9">[1]</a></dt></dl></td><td width="33%" valign="top"><dl>
+<dt><a href="CoroutinesAndConcurrency.html#index-3">multiprocessing</a></dt></dl></td><td width="33%" valign="top"><dl>
 </dl></td></tr></table>
 
 <h2 id="P">P</h2>
 <table width="100%" class="indextable"><tr><td width="33%" valign="top">
 <dl>
 
-<dt><a href="CoroutinesAndConcurrency.html#index-6">parallelism</a>, <a href="_test/CoroutinesAndConcurrency.html#index-9">[1]</a></dt>
+<dt><a href="CoroutinesAndConcurrency.html#index-3">parallelism</a></dt>
 <dt>Python 3</dt>
   <dd><dl>
-    <dt><a href="_test/LanguageChanges.html#index-11">Language differences</a>, <a href="LanguageChanges.html#index-4">[1]</a></dt>
+    <dt><a href="LanguageChanges.html#index-7">Language differences</a></dt>
   </dl></dd></dl></td><td width="33%" valign="top"><dl>
 </dl></td></tr></table>
 
 
 <dt>script</dt>
   <dd><dl>
-    <dt><a href="CanonicalScript.html#index-0">command-line canonical form</a>, <a href="_test/CanonicalScript.html#index-7">[1]</a></dt>
+    <dt><a href="CanonicalScript.html#index-0">command-line canonical form</a></dt>
   </dl></dd></dl></td><td width="33%" valign="top"><dl>
 </dl></td></tr></table>
 
 <table width="100%" class="indextable"><tr><td width="33%" valign="top">
 <dl>
 
-<dt><a href="CoroutinesAndConcurrency.html#index-6">threads</a>, <a href="_test/CoroutinesAndConcurrency.html#index-9">[1]</a></dt></dl></td><td width="33%" valign="top"><dl>
+<dt><a href="CoroutinesAndConcurrency.html#index-3">threads</a></dt></dl></td><td width="33%" valign="top"><dl>
 </dl></td></tr></table>
 
 
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Nov 10, 2008.
+      Last updated on Nov 11, 2008.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
     </div>
   </body>
   <div class="section" id="python-3-patterns-idioms">
 <h1>Python 3 Patterns &amp; Idioms<a class="headerlink" href="#python-3-patterns-idioms" title="Permalink to this headline">¶</a></h1>
 <ul>
-<li><a class="reference external" href="Contributors.html">Contributors</a><ul>
-<li><a class="reference external" href="Contributors.html#thanks-to">Thanks To</a></li>
+<li class="toctree-l1"><a class="reference external" href="Contributors.html">Contributors</a><ul>
+<li class="toctree-l2"><a class="reference external" href="Contributors.html#thanks-to">Thanks To</a></li>
 </ul>
 </li>
 </ul>
 <ul>
-<li><a class="reference external" href="NoteToReaders.html">A Note To Readers</a></li>
+<li class="toctree-l1"><a class="reference external" href="ToDo.html">ToDo List</a></li>
+<li class="toctree-l1"><a class="reference external" href="ToDo.html#the-remainder-are-from-context-from-the-book">The remainder are from context, from the book.</a></li>
 </ul>
 <ul>
-<li><a class="reference external" href="Introduction.html">Introduction</a><ul>
-<li><a class="reference external" href="Introduction.html#a-team-effort">A Team Effort</a></li>
-<li><a class="reference external" href="Introduction.html#not-an-introductory-book">Not an Introductory Book</a></li>
-<li><a class="reference external" href="Introduction.html#the-license">The License</a></li>
-<li><a class="reference external" href="Introduction.html#the-printed-book">The Printed Book</a></li>
-<li><a class="reference external" href="Introduction.html#translations">Translations</a></li>
-<li><a class="reference external" href="Introduction.html#my-motives">My Motives</a></li>
+<li class="toctree-l1"><a class="reference external" href="NoteToReaders.html">A Note To Readers</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference external" href="Introduction.html">Introduction</a><ul>
+<li class="toctree-l2"><a class="reference external" href="Introduction.html#a-team-effort">A Team Effort</a></li>
+<li class="toctree-l2"><a class="reference external" href="Introduction.html#not-an-introductory-book">Not an Introductory Book</a></li>
+<li class="toctree-l2"><a class="reference external" href="Introduction.html#the-license">The License</a></li>
+<li class="toctree-l2"><a class="reference external" href="Introduction.html#the-printed-book">The Printed Book</a></li>
+<li class="toctree-l2"><a class="reference external" href="Introduction.html#translations">Translations</a></li>
+<li class="toctree-l2"><a class="reference external" href="Introduction.html#my-motives">My Motives</a></li>
 </ul>
 </li>
 </ul>
 <ul>
-<li><a class="reference external" href="TeachingSupport.html">Teaching Support</a></li>
+<li class="toctree-l1"><a class="reference external" href="TeachingSupport.html">Teaching Support</a></li>
 </ul>
 <ul>
-<li><a class="reference external" href="Rules.html">Book Development Rules</a><ul>
-<li><a class="reference external" href="Rules.html#contribute-what-you-can">Contribute What You Can</a></li>
-<li><a class="reference external" href="Rules.html#don-t-get-attached">Don&#8217;t Get Attached</a></li>
-<li><a class="reference external" href="Rules.html#credit">Credit</a></li>
-<li><a class="reference external" href="Rules.html#mechanics">Mechanics</a></li>
-<li><a class="reference external" href="Rules.html#diagrams">Diagrams</a></li>
+<li class="toctree-l1"><a class="reference external" href="Rules.html">Book Development Rules</a><ul>
+<li class="toctree-l2"><a class="reference external" href="Rules.html#contribute-what-you-can">Contribute What You Can</a></li>
+<li class="toctree-l2"><a class="reference external" href="Rules.html#don-t-get-attached">Don&#8217;t Get Attached</a></li>
+<li class="toctree-l2"><a class="reference external" href="Rules.html#credit">Credit</a></li>
+<li class="toctree-l2"><a class="reference external" href="Rules.html#mechanics">Mechanics</a></li>
+<li class="toctree-l2"><a class="reference external" href="Rules.html#diagrams">Diagrams</a></li>
 </ul>
 </li>
 </ul>
 <ul>
-<li><a class="reference external" href="DeveloperGuide.html">Developer Guide</a><ul>
-<li><a class="reference external" href="DeveloperGuide.html#getting-started-the-easiest-approach">Getting Started: The Easiest Approach</a></li>
-<li><a class="reference external" href="DeveloperGuide.html#for-windows-users">For Windows Users</a></li>
-<li><a class="reference external" href="DeveloperGuide.html#installing-sphinx">Installing Sphinx</a></li>
-<li><a class="reference external" href="DeveloperGuide.html#getting-the-development-branch-of-the-book">Getting the Development Branch of the Book</a></li>
-<li><a class="reference external" href="DeveloperGuide.html#building-the-book">Building the Book</a></li>
-<li><a class="reference external" href="DeveloperGuide.html#working-with-bitbucket-and-mercurial">Working with BitBucket and Mercurial</a></li>
+<li class="toctree-l1"><a class="reference external" href="DeveloperGuide.html">Developer Guide</a><ul>
+<li class="toctree-l2"><a class="reference external" href="DeveloperGuide.html#getting-started-the-easiest-approach">Getting Started: The Easiest Approach</a></li>
+<li class="toctree-l2"><a class="reference external" href="DeveloperGuide.html#for-windows-users">For Windows Users</a></li>
+<li class="toctree-l2"><a class="reference external" href="DeveloperGuide.html#installing-sphinx">Installing Sphinx</a></li>
+<li class="toctree-l2"><a class="reference external" href="DeveloperGuide.html#getting-the-development-branch-of-the-book">Getting the Development Branch of the Book</a></li>
+<li class="toctree-l2"><a class="reference external" href="DeveloperGuide.html#building-the-book">Building the Book</a></li>
 </ul>
 </li>
 </ul>
 <ul>
-<li><a class="reference external" href="Part1.html">Part I: Foundations</a></li>
+<li class="toctree-l1"><a class="reference external" href="Part1.html">Part I: Foundations</a></li>
 </ul>
 <ul>
-<li><a class="reference external" href="quickPython.html">Quick Python for Programmers</a><ul>
-<li><a class="reference external" href="quickPython.html#scripting-vs-programming">Scripting vs. Programming</a></li>
-<li><a class="reference external" href="quickPython.html#built-in-containers">Built-In Containers</a></li>
-<li><a class="reference external" href="quickPython.html#functions">Functions</a></li>
-<li><a class="reference external" href="quickPython.html#strings">Strings</a></li>
-<li><a class="reference external" href="quickPython.html#classes">Classes</a><ul>
-<li><a class="reference external" href="quickPython.html#inheritance">Inheritance</a></li>
+<li class="toctree-l1"><a class="reference external" href="quickPython.html">Quick Python for Programmers</a><ul>
+<li class="toctree-l2"><a class="reference external" href="quickPython.html#scripting-vs-programming">Scripting vs. Programming</a></li>
+<li class="toctree-l2"><a class="reference external" href="quickPython.html#built-in-containers">Built-In Containers</a></li>
+<li class="toctree-l2"><a class="reference external" href="quickPython.html#functions">Functions</a></li>
+<li class="toctree-l2"><a class="reference external" href="quickPython.html#strings">Strings</a></li>
+<li class="toctree-l2"><a class="reference external" href="quickPython.html#classes">Classes</a><ul>
+<li class="toctree-l3"><a class="reference external" href="quickPython.html#inheritance">Inheritance</a></li>
 </ul>
 </li>
 </ul>
 </li>
 </ul>
 <ul>
-<li><a class="reference external" href="unitTesting.html">Unit Testing &amp; Test-Driven Development</a><ul>
-<li><a class="reference external" href="unitTesting.html#write-tests-first">Write Tests First</a></li>
-<li><a class="reference external" href="unitTesting.html#simple-python-testing">Simple Python Testing</a></li>
-<li><a class="reference external" href="unitTesting.html#a-very-simple-framework">A Very Simple Framework</a></li>
-<li><a class="reference external" href="unitTesting.html#writing-tests">Writing Tests</a></li>
-<li><a class="reference external" href="unitTesting.html#white-box-black-box-tests">White-Box &amp; Black-Box Tests</a></li>
-<li><a class="reference external" href="unitTesting.html#running-tests">Running tests</a></li>
-<li><a class="reference external" href="unitTesting.html#automatically-executing-tests">Automatically Executing Tests</a></li>
-<li><a class="reference external" href="unitTesting.html#exercises">Exercises</a></li>
+<li class="toctree-l1"><a class="reference external" href="unitTesting.html">Unit Testing &amp; Test-Driven Development</a><ul>
+<li class="toctree-l2"><a class="reference external" href="unitTesting.html#write-tests-first">Write Tests First</a></li>
+<li class="toctree-l2"><a class="reference external" href="unitTesting.html#simple-python-testing">Simple Python Testing</a></li>
+<li class="toctree-l2"><a class="reference external" href="unitTesting.html#a-very-simple-framework">A Very Simple Framework</a></li>
+<li class="toctree-l2"><a class="reference external" href="unitTesting.html#writing-tests">Writing Tests</a></li>
+<li class="toctree-l2"><a class="reference external" href="unitTesting.html#white-box-black-box-tests">White-Box &amp; Black-Box Tests</a></li>
+<li class="toctree-l2"><a class="reference external" href="unitTesting.html#running-tests">Running tests</a></li>
+<li class="toctree-l2"><a class="reference external" href="unitTesting.html#automatically-executing-tests">Automatically Executing Tests</a></li>
+<li class="toctree-l2"><a class="reference external" href="unitTesting.html#exercises">Exercises</a></li>
 </ul>
 </li>
 </ul>
 <ul>
-<li><a class="reference external" href="LanguageChanges.html">Python 3 Language Changes</a></li>
+<li class="toctree-l1"><a class="reference external" href="LanguageChanges.html">Python 3 Language Changes</a></li>
 </ul>
 <ul>
-<li><a class="reference external" href="PythonDecorators.html">Decorators</a><ul>
-<li><a class="reference external" href="PythonDecorators.html#decorators-vs-the-decorator-pattern">Decorators vs. the Decorator Pattern</a></li>
-<li><a class="reference external" href="PythonDecorators.html#history-of-macros">History of Macros</a></li>
-<li><a class="reference external" href="PythonDecorators.html#the-goal-of-macros">The Goal of Macros</a></li>
-<li><a class="reference external" href="PythonDecorators.html#what-can-you-do-with-decorators">What Can You Do With Decorators?</a></li>
-<li><a class="reference external" href="PythonDecorators.html#function-decorators">Function Decorators</a></li>
-<li><a class="reference external" href="PythonDecorators.html#slightly-more-useful">Slightly More Useful</a></li>
-<li><a class="reference external" href="PythonDecorators.html#using-functions-as-decorators">Using Functions as Decorators</a></li>
-<li><a class="reference external" href="PythonDecorators.html#review-decorators-without-arguments">Review: Decorators without Arguments</a></li>
-<li><a class="reference external" href="PythonDecorators.html#decorators-with-arguments">Decorators with Arguments</a></li>
-<li><a class="reference external" href="PythonDecorators.html#decorator-functions-with-decorator-arguments">Decorator Functions with Decorator Arguments</a></li>
-<li><a class="reference external" href="PythonDecorators.html#further-reading">Further Reading</a></li>
+<li class="toctree-l1"><a class="reference external" href="PythonDecorators.html">Decorators</a><ul>
+<li class="toctree-l2"><a class="reference external" href="PythonDecorators.html#decorators-vs-the-decorator-pattern">Decorators vs. the Decorator Pattern</a></li>
+<li class="toctree-l2"><a class="reference external" href="PythonDecorators.html#history-of-macros">History of Macros</a></li>
+<li class="toctree-l2"><a class="reference external" href="PythonDecorators.html#the-goal-of-macros">The Goal of Macros</a></li>
+<li class="toctree-l2"><a class="reference external" href="PythonDecorators.html#what-can-you-do-with-decorators">What Can You Do With Decorators?</a></li>
+<li class="toctree-l2"><a class="reference external" href="PythonDecorators.html#function-decorators">Function Decorators</a></li>
+<li class="toctree-l2"><a class="reference external" href="PythonDecorators.html#slightly-more-useful">Slightly More Useful</a></li>
+<li class="toctree-l2"><a class="reference external" href="PythonDecorators.html#using-functions-as-decorators">Using Functions as Decorators</a></li>
+<li class="toctree-l2"><a class="reference external" href="PythonDecorators.html#review-decorators-without-arguments">Review: Decorators without Arguments</a></li>
+<li class="toctree-l2"><a class="reference external" href="PythonDecorators.html#decorators-with-arguments">Decorators with Arguments</a></li>
+<li class="toctree-l2"><a class="reference external" href="PythonDecorators.html#decorator-functions-with-decorator-arguments">Decorator Functions with Decorator Arguments</a></li>
+<li class="toctree-l2"><a class="reference external" href="PythonDecorators.html#further-reading">Further Reading</a></li>
 </ul>
 </li>
 </ul>
 <ul>
-<li><a class="reference external" href="GeneratorsIterators.html">Generators, Iterators, and Itertools</a></li>
+<li class="toctree-l1"><a class="reference external" href="GeneratorsIterators.html">Generators, Iterators, and Itertools</a></li>
 </ul>
 <ul>
-<li><a class="reference external" href="Comprehensions.html">Comprehensions</a><ul>
-<li><a class="reference external" href="Comprehensions.html#a-more-complex-example">A More Complex Example</a></li>
+<li class="toctree-l1"><a class="reference external" href="Comprehensions.html">Comprehensions</a><ul>
+<li class="toctree-l2"><a class="reference external" href="Comprehensions.html#a-more-complex-example">A More Complex Example</a></li>
 </ul>
 </li>
 </ul>
 <ul>
-<li><a class="reference external" href="CoroutinesAndConcurrency.html">Coroutines &amp; Concurrency</a><ul>
-<li><a class="reference external" href="CoroutinesAndConcurrency.html#further-reading">Further Reading</a></li>
+<li class="toctree-l1"><a class="reference external" href="CoroutinesAndConcurrency.html">Coroutines &amp; Concurrency</a><ul>
+<li class="toctree-l2"><a class="reference external" href="CoroutinesAndConcurrency.html#further-reading">Further Reading</a></li>
 </ul>
 </li>
 </ul>
 <ul>
-<li><a class="reference external" href="jython.html">Jython</a><ul>
-<li><a class="reference external" href="jython.html#interpreter-motivation">Interpreter Motivation</a></li>
-<li><a class="reference external" href="jython.html#creating-a-language">Creating a Language</a></li>
-<li><a class="reference external" href="jython.html#controlling-the-interpreter">Controlling the Interpreter</a><ul>
-<li><a class="reference external" href="jython.html#putting-data-in">Putting Data In</a></li>
-<li><a class="reference external" href="jython.html#getting-data-out">Getting Data Out</a></li>
-<li><a class="reference external" href="jython.html#multiple-interpreters">Multiple Interpreters</a></li>
+<li class="toctree-l1"><a class="reference external" href="jython.html">Jython</a><ul>
+<li class="toctree-l2"><a class="reference external" href="jython.html#interpreter-motivation">Interpreter Motivation</a></li>
+<li class="toctree-l2"><a class="reference external" href="jython.html#creating-a-language">Creating a Language</a></li>
+<li class="toctree-l2"><a class="reference external" href="jython.html#controlling-the-interpreter">Controlling the Interpreter</a><ul>
+<li class="toctree-l3"><a class="reference external" href="jython.html#putting-data-in">Putting Data In</a></li>
+<li class="toctree-l3"><a class="reference external" href="jython.html#getting-data-out">Getting Data Out</a></li>
+<li class="toctree-l3"><a class="reference external" href="jython.html#multiple-interpreters">Multiple Interpreters</a></li>
 </ul>
 </li>
-<li><a class="reference external" href="jython.html#controlling-java-from-jython">Controlling Java from Jython</a><ul>
-<li><a class="reference external" href="jython.html#inner-classes">Inner Classes</a></li>
+<li class="toctree-l2"><a class="reference external" href="jython.html#controlling-java-from-jython">Controlling Java from Jython</a><ul>
+<li class="toctree-l3"><a class="reference external" href="jython.html#inner-classes">Inner Classes</a></li>
 </ul>
 </li>
-<li><a class="reference external" href="jython.html#using-java-libraries">Using Java libraries</a><ul>
-<li><a class="reference external" href="jython.html#inheriting-from-java-library-classes">Inheriting from Java library Classes</a></li>
+<li class="toctree-l2"><a class="reference external" href="jython.html#using-java-libraries">Using Java libraries</a><ul>
+<li class="toctree-l3"><a class="reference external" href="jython.html#inheriting-from-java-library-classes">Inheriting from Java library Classes</a></li>
 </ul>
 </li>
-<li><a class="reference external" href="jython.html#creating-java-classes-with-jython">Creating Java classes with Jython</a><ul>
-<li><a class="reference external" href="jython.html#building-java-classes-from-python">Building Java Classes from Python</a></li>
+<li class="toctree-l2"><a class="reference external" href="jython.html#creating-java-classes-with-jython">Creating Java classes with Jython</a><ul>
+<li class="toctree-l3"><a class="reference external" href="jython.html#building-java-classes-from-python">Building Java Classes from Python</a></li>
 </ul>
 </li>
-<li><a class="reference external" href="jython.html#summary">Summary</a></li>
-<li><a class="reference external" href="jython.html#exercises">Exercises</a></li>
+<li class="toctree-l2"><a class="reference external" href="jython.html#summary">Summary</a></li>
+<li class="toctree-l2"><a class="reference external" href="jython.html#exercises">Exercises</a></li>
 </ul>
 </li>
 </ul>
 <ul>
-<li><a class="reference external" href="Part2.html">Part II: Idioms</a></li>
+<li class="toctree-l1"><a class="reference external" href="Part2.html">Part II: Idioms</a></li>
 </ul>
 <ul>
-<li><a class="reference external" href="MachineDiscovery.html">Discovering the Details About Your Platform</a></li>
+<li class="toctree-l1"><a class="reference external" href="MachineDiscovery.html">Discovering the Details About Your Platform</a></li>
 </ul>
 <ul>
-<li><a class="reference external" href="CanonicalScript.html">A Canonical Form for Command-Line Programs</a></li>
+<li class="toctree-l1"><a class="reference external" href="CanonicalScript.html">A Canonical Form for Command-Line Programs</a></li>
 </ul>
 <ul>
-<li><a class="reference external" href="Part3.html">Part III: Patterns</a></li>
+<li class="toctree-l1"><a class="reference external" href="Part3.html">Part III: Patterns</a></li>
 </ul>
 <ul>
-<li><a class="reference external" href="patternConcept.html">The Pattern Concept</a><ul>
-<li><a class="reference external" href="patternConcept.html#what-is-a-pattern">What is a Pattern?</a></li>
-<li><a class="reference external" href="patternConcept.html#classifying-patterns">Classifying Patterns</a></li>
-<li><a class="reference external" href="patternConcept.html#pattern-taxonomy">Pattern Taxonomy</a></li>
-<li><a class="reference external" href="patternConcept.html#design-structures">Design Structures</a></li>
-<li><a class="reference external" href="patternConcept.html#design-principles">Design Principles</a></li>
+<li class="toctree-l1"><a class="reference external" href="patternConcept.html">The Pattern Concept</a><ul>
+<li class="toctree-l2"><a class="reference external" href="patternConcept.html#what-is-a-pattern">What is a Pattern?</a></li>
+<li class="toctree-l2"><a class="reference external" href="patternConcept.html#classifying-patterns">Classifying Patterns</a></li>
+<li class="toctree-l2"><a class="reference external" href="patternConcept.html#pattern-taxonomy">Pattern Taxonomy</a></li>
+<li class="toctree-l2"><a class="reference external" href="patternConcept.html#design-structures">Design Structures</a></li>
+<li class="toctree-l2"><a class="reference external" href="patternConcept.html#design-principles">Design Principles</a></li>
 </ul>
 </li>
 </ul>
 <ul>
-<li><a class="reference external" href="singleton.html">The Singleton</a><ul>
-<li><a class="reference external" href="singleton.html#exercises">Exercises</a></li>
+<li class="toctree-l1"><a class="reference external" href="singleton.html">The Singleton</a><ul>
+<li class="toctree-l2"><a class="reference external" href="singleton.html#exercises">Exercises</a></li>
 </ul>
 </li>
 </ul>
 <ul>
-<li><a class="reference external" href="appFrameworks.html">Building Application Frameworks</a><ul>
-<li><a class="reference external" href="appFrameworks.html#template-method">Template Method</a></li>
-<li><a class="reference external" href="appFrameworks.html#exercises">Exercises</a></li>
+<li class="toctree-l1"><a class="reference external" href="appFrameworks.html">Building Application Frameworks</a><ul>