Bruce Eckel avatar Bruce Eckel committed 97683e7

Oops. Forgot to build the html before posting.

Comments (0)

Files changed (53)

code/Jython/GreenHouseLanguage.py

         self.time = time
         Event.events.append(self)
 
-    def __cmp__ (self, other):
-        """
-        So sort() will compare only on time.
-        """
-        if self.time < other.time: return -1
-        if self.time > other.time: return 1
-        return 0
-
-    def run(self):
-        print("%.2f: %s" % (self.time, self.action))
-
-class LightOn(Event):
-    def __init__(self, time):
-        Event.__init__(self, "Light on", time)
-
-class LightOff(Event):
-    def __init__(self, time):
-        Event.__init__(self, "Light off", time)
-
-class WaterOn(Event):
-    def __init__(self, time):
-        Event.__init__(self, "Water on", time)
-
-class WaterOff(Event):
-    def __init__(self, time):
-        Event.__init__(self, "Water off", time)
-
-class ThermostatNight(Event):
-    def __init__(self, time):
-        Event.__init__(self,"Thermostat night", time)
-
-class ThermostatDay(Event):
-    def __init__(self, time):
-        Event.__init__(self, "Thermostat day", time)
-
-class Bell(Event):
-    def __init__(self, time):
-        Event.__init__(self, "Ring bell", time)
-
-def run():
-    Event.events.sort();
-    for e in Event.events:
-        e.run()
-
-if __name__ == "__main__":
-    ThermostatNight(5.00)
-    LightOff(2.00)
-    WaterOn(3.30)
-    WaterOff(4.45)
-    LightOn(1.00)
-    ThermostatDay(6.00)
-    Bell(7.00)
-    run()
+    def __cmp__ (self, other):

code/Metaclasses/GreenHouse.py

     exec initializations in globals()
     [create_exec(dsc) for dsc in descriptions]
     exec initializations in globals()
-    Event.run_events()
+    Event.run_events()

code/Metaclasses/MyList.py

 ml.append("Camembert")
 print(ml)
 print(ml.x)
-ml.howdy("John")
-
+ml.howdy("John")

code/Metaclasses/RegisterLeafClasses.py

 (Red, CeruleanBlue, Yellow, PhthaloBlue, Green)
 (Square, Round, Boxy, Triangular)
 (Square, Ellipse, Boxy, Circle, Triangular)
-"""
+"""

code/Metaclasses/SimpleMeta1.py

 """ Output:
 ['bar', 'foo', 'uses_metaclass']
 Yes!
-"""
+"""

code/Metaclasses/SimpleMeta2.py

 
 """ Output:
 Yes!
-"""
+"""

code/Metaclasses/SimpleMeta3.py

 
 """ Output:
 Yes!
-"""
+"""

html/AppFrameworks.html

 <!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">
+  "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" />
     
 
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="Singleton.html" title="previous chapter">The Singleton</a></p>
+            <p class="topless"><a href="Singleton.html"
+                                  title="previous chapter">The Singleton</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="Fronting.html" title="next chapter">Fronting for an Implementation</a></p>
+            <p class="topless"><a href="Fronting.html"
+                                  title="next chapter">Fronting for an Implementation</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
-              <li><a href="_sources/AppFrameworks.txt" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/AppFrameworks.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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 class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 26, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </div>
   </body>

html/CanonicalScript.html

 <!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">
+  "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" />
     
     
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="MachineDiscovery.html" title="previous chapter">Discovering the Details About Your Platform</a></p>
+            <p class="topless"><a href="MachineDiscovery.html"
+                                  title="previous chapter">Discovering the Details About Your Platform</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="Messenger.html" title="next chapter">Messenger/Data Transfer Object</a></p>
+            <p class="topless"><a href="Messenger.html"
+                                  title="next chapter">Messenger/Data Transfer Object</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
-              <li><a href="_sources/CanonicalScript.txt" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/CanonicalScript.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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 class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 26, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </div>
   </body>

html/ChangeInterface.html

 <!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">
+  "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" />
     
 
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="FunctionObjects.html" title="previous chapter">Function Objects</a></p>
+            <p class="topless"><a href="FunctionObjects.html"
+                                  title="previous chapter">Function Objects</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="TableDriven.html" title="next chapter">Table-Driven Code: Configuration Flexibility</a></p>
+            <p class="topless"><a href="TableDriven.html"
+                                  title="next chapter">Table-Driven Code: Configuration Flexibility</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
-              <li><a href="_sources/ChangeInterface.txt" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/ChangeInterface.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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 class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 26, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </div>
   </body>

html/Comprehensions.html

 <!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">
+  "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" />
     
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="top" title="Python 3 Patterns, Recipes and Idioms" href="index.html" />
-    <link rel="next" title="Coroutines &amp; Concurrency" href="CoroutinesAndConcurrency.html" />
+    <link rel="next" title="Coroutines & Concurrency" href="CoroutinesAndConcurrency.html" />
     <link rel="prev" title="Generators, Iterators, and Itertools" href="GeneratorsIterators.html" /> 
   </head>
   <body>
           <a href="genindex.html" title="General Index"
              accesskey="I">index</a></li>
         <li class="right" >
-          <a href="CoroutinesAndConcurrency.html" title="Coroutines &amp; Concurrency"
+          <a href="CoroutinesAndConcurrency.html" title="Coroutines & Concurrency"
              accesskey="N">next</a> |</li>
         <li class="right" >
           <a href="GeneratorsIterators.html" title="Generators, Iterators, and Itertools"
 <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-python"><div class="highlight"><pre><span class="c"># Comprehensions/os_walk_comprehension.py</span>
-<span class="k">import</span> <span class="nn">os</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="sd">file path) into your restructured text file, then run the update program to</span>
 <span class="sd">automatically insert the rest of the file.</span>
 <span class="sd">&quot;&quot;&quot;</span>
-<span class="k">import</span> <span class="nn">os</span><span class="o">,</span> <span class="nn">re</span><span class="o">,</span> <span class="nn">sys</span><span class="o">,</span> <span class="nn">shutil</span><span class="o">,</span> <span class="nn">inspect</span><span class="o">,</span> <span class="nn">difflib</span>
+<span class="kn">import</span> <span class="nn">os</span><span class="o">,</span> <span class="nn">re</span><span class="o">,</span> <span class="nn">sys</span><span class="o">,</span> <span class="nn">shutil</span><span class="o">,</span> <span class="nn">inspect</span><span class="o">,</span> <span class="nn">difflib</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">if</span> <span class="ow">not</span> <span class="s">&quot;_test&quot;</span> <span class="ow">in</span> <span class="n">d</span><span class="p">[</span><span class="mf">0</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>
 
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="GeneratorsIterators.html" title="previous chapter">Generators, Iterators, and Itertools</a></p>
+            <p class="topless"><a href="GeneratorsIterators.html"
+                                  title="previous chapter">Generators, Iterators, and Itertools</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="CoroutinesAndConcurrency.html" title="next chapter">Coroutines &amp; Concurrency</a></p>
+            <p class="topless"><a href="CoroutinesAndConcurrency.html"
+                                  title="next chapter">Coroutines &amp; Concurrency</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
-              <li><a href="_sources/Comprehensions.txt" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/Comprehensions.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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>
           <a href="genindex.html" title="General Index"
              accesskey="I">index</a></li>
         <li class="right" >
-          <a href="CoroutinesAndConcurrency.html" title="Coroutines &amp; Concurrency"
+          <a href="CoroutinesAndConcurrency.html" title="Coroutines & Concurrency"
              accesskey="N">next</a> |</li>
         <li class="right" >
           <a href="GeneratorsIterators.html" title="Generators, Iterators, and Itertools"
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 26, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </div>
   </body>

html/Contributors.html

 <!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">
+  "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" />
     
 
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="index.html" title="previous chapter">Python 3 Patterns, Recipes and Idioms</a></p>
+            <p class="topless"><a href="index.html"
+                                  title="previous chapter">Python 3 Patterns, Recipes and Idioms</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="ToDo.html" title="next chapter">ToDo List</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" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/Contributors.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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 class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 26, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </div>
   </body>

html/CoroutinesAndConcurrency.html

 <!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">
+  "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>Coroutines &amp; Concurrency &mdash; Python 3 Patterns, Recipes and Idioms</title>
+    <title>Coroutines & Concurrency &mdash; Python 3 Patterns, Recipes and 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">
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="top" title="Python 3 Patterns, Recipes and Idioms" href="index.html" />
-    <link rel="next" title="Jython" href="Jython.html" />
+    <link rel="next" title="Metaclasses" href="Metaclasses.html" />
     <link rel="prev" title="Comprehensions" href="Comprehensions.html" /> 
   </head>
   <body>
           <a href="genindex.html" title="General Index"
              accesskey="I">index</a></li>
         <li class="right" >
-          <a href="Jython.html" title="Jython"
+          <a href="Metaclasses.html" title="Metaclasses"
              accesskey="N">next</a> |</li>
         <li class="right" >
           <a href="Comprehensions.html" title="Comprehensions"
 
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="Comprehensions.html" title="previous chapter">Comprehensions</a></p>
+            <p class="topless"><a href="Comprehensions.html"
+                                  title="previous chapter">Comprehensions</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="Jython.html" title="next chapter">Jython</a></p>
+            <p class="topless"><a href="Metaclasses.html"
+                                  title="next chapter">Metaclasses</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
-              <li><a href="_sources/CoroutinesAndConcurrency.txt" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/CoroutinesAndConcurrency.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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>
           <a href="genindex.html" title="General Index"
              accesskey="I">index</a></li>
         <li class="right" >
-          <a href="Jython.html" title="Jython"
+          <a href="Metaclasses.html" title="Metaclasses"
              accesskey="N">next</a> |</li>
         <li class="right" >
           <a href="Comprehensions.html" title="Comprehensions"
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 26, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </div>
   </body>

html/Decorator.html

 <!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">
+  "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" />
     
 
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="StateMachine.html" title="previous chapter">StateMachine</a></p>
+            <p class="topless"><a href="StateMachine.html"
+                                  title="previous chapter">StateMachine</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="Iterators.html" title="next chapter">Iterators: Decoupling Algorithms from Containers</a></p>
+            <p class="topless"><a href="Iterators.html"
+                                  title="next chapter">Iterators: Decoupling Algorithms from Containers</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
-              <li><a href="_sources/Decorator.txt" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/Decorator.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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 class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 26, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </div>
   </body>

html/DeveloperGuide.html

 <!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">
+  "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" />
     
 <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-12">
+<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>
 - hg clone python-3-patterns-idioms devel</li>
 </ul>
 </blockquote>
-<div class="admonition-todo admonition " id="todo-13">
+<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">
 <p><strong>Linux</strong>: It&#8217;s virtually guaranteed that you already have emacs preinstalled
 on your Linux distribution, which you can start from a command prompt. However,
 there may also be more &#8220;windowy&#8221; versions that you can install separately.</p>
-<div class="admonition-todo admonition " id="todo-14">
+<div class="admonition-todo admonition " id="todo-6">
 <p class="first admonition-title">Todo</p>
 <p class="last">Someone who knows more about emacs for Linux please add more specific information about the windowed version(s).</p>
 </div>
 
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="Rules.html" title="previous chapter">Book Development Rules</a></p>
+            <p class="topless"><a href="Rules.html"
+                                  title="previous chapter">Book Development Rules</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="Part1.html" title="next chapter">Part I: Foundations</a></p>
+            <p class="topless"><a href="Part1.html"
+                                  title="next chapter">Part I: Foundations</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
-              <li><a href="_sources/DeveloperGuide.txt" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/DeveloperGuide.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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 class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 26, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </div>
   </body>

html/Factory.html

 <!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">
+  "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" />
     
 <p>One approach is to make the factory a <strong>static</strong> method of the base class:</p>
 <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="k">from</span> <span class="nn">__future__</span> <span class="k">import</span> <span class="n">generators</span>
-<span class="k">import</span> <span class="nn">random</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="k">class</span> <span class="nc">Shape</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
     <span class="c"># Create based on class name:</span>
 <p>To disallow direct access to the classes, you can nest the classes within the
 factory method, like this:</p>
 <div class="highlight-python"><div class="highlight"><pre><span class="c"># Factory/shapefact1/NestedShapeFactory.py</span>
-<span class="k">import</span> <span class="nn">random</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>
     <span class="n">types</span> <span class="o">=</span> <span class="p">[]</span>
 that the specific <strong>Shape</strong> classes are dynamically loaded on demand:</p>
 <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="k">from</span> <span class="nn">__future__</span> <span class="k">import</span> <span class="n">generators</span>
-<span class="k">import</span> <span class="nn">random</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="k">class</span> <span class="nc">ShapeFactory</span><span class="p">:</span>
     <span class="n">factories</span> <span class="o">=</span> <span class="p">{}</span>
 
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="Iterators.html" title="previous chapter">Iterators: Decoupling Algorithms from Containers</a></p>
+            <p class="topless"><a href="Iterators.html"
+                                  title="previous chapter">Iterators: Decoupling Algorithms from Containers</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="FunctionObjects.html" title="next chapter">Function Objects</a></p>
+            <p class="topless"><a href="FunctionObjects.html"
+                                  title="next chapter">Function Objects</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
-              <li><a href="_sources/Factory.txt" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/Factory.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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 class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 26, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </div>
   </body>

html/Fronting.html

 <!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">
+  "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" />
     
 
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="AppFrameworks.html" title="previous chapter">Building Application Frameworks</a></p>
+            <p class="topless"><a href="AppFrameworks.html"
+                                  title="previous chapter">Building Application Frameworks</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="StateMachine.html" title="next chapter">StateMachine</a></p>
+            <p class="topless"><a href="StateMachine.html"
+                                  title="next chapter">StateMachine</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
-              <li><a href="_sources/Fronting.txt" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/Fronting.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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 class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 26, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </div>
   </body>

html/FunctionObjects.html

 <!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">
+  "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" />
     
 
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="Factory.html" title="previous chapter">Factory: Encapsulating Object Creation</a></p>
+            <p class="topless"><a href="Factory.html"
+                                  title="previous chapter">Factory: Encapsulating Object Creation</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="ChangeInterface.html" title="next chapter">Changing the Interface</a></p>
+            <p class="topless"><a href="ChangeInterface.html"
+                                  title="next chapter">Changing the Interface</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
-              <li><a href="_sources/FunctionObjects.txt" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/FunctionObjects.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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 class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 26, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </div>
   </body>

html/GeneratorsIterators.html

 <!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">
+  "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" />
     
           <div class="body">
             
   <div class="section" id="generators-iterators-and-itertools">
-<span id="index-8"></span><h1>Generators, Iterators, and Itertools<a class="headerlink" href="#generators-iterators-and-itertools" title="Permalink to this headline">¶</a></h1>
+<span id="index-7"></span><h1>Generators, Iterators, and Itertools<a class="headerlink" href="#generators-iterators-and-itertools" title="Permalink to this headline">¶</a></h1>
 </div>
 
 
     
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="PythonDecorators.html" title="previous chapter">Decorators</a></p>
+            <p class="topless"><a href="PythonDecorators.html"
+                                  title="previous chapter">Decorators</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="Comprehensions.html" title="next chapter">Comprehensions</a></p>
+            <p class="topless"><a href="Comprehensions.html"
+                                  title="next chapter">Comprehensions</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
-              <li><a href="_sources/GeneratorsIterators.txt" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/GeneratorsIterators.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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 class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 26, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </div>
   </body>

html/Introduction.html

 <!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">
+  "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" />
     
 
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="NoteToReaders.html" title="previous chapter">A Note To Readers</a></p>
+            <p class="topless"><a href="NoteToReaders.html"
+                                  title="previous chapter">A Note To Readers</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="TeachingSupport.html" title="next chapter">Teaching Support</a></p>
+            <p class="topless"><a href="TeachingSupport.html"
+                                  title="next chapter">Teaching Support</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
-              <li><a href="_sources/Introduction.txt" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/Introduction.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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 class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 26, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </div>
   </body>

html/Iterators.html

 <!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">
+  "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" />
     
 
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="Decorator.html" title="previous chapter">Decorator: Dynamic Type Selection</a></p>
+            <p class="topless"><a href="Decorator.html"
+                                  title="previous chapter">Decorator: Dynamic Type Selection</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="Factory.html" title="next chapter">Factory: Encapsulating Object Creation</a></p>
+            <p class="topless"><a href="Factory.html"
+                                  title="next chapter">Factory: Encapsulating Object Creation</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
-              <li><a href="_sources/Iterators.txt" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/Iterators.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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 class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 26, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </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">
+  "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" />
     
     <link rel="search" title="Search" href="search.html" />
     <link rel="top" title="Python 3 Patterns, Recipes and Idioms" href="index.html" />
     <link rel="next" title="Part II: Idioms" href="Part2.html" />
-    <link rel="prev" title="Coroutines &amp; Concurrency" href="CoroutinesAndConcurrency.html" /> 
+    <link rel="prev" title="Metaclasses" href="Metaclasses.html" /> 
   </head>
   <body>
     <div class="related">
           <a href="Part2.html" title="Part II: Idioms"
              accesskey="N">next</a> |</li>
         <li class="right" >
-          <a href="CoroutinesAndConcurrency.html" title="Coroutines &amp; Concurrency"
+          <a href="Metaclasses.html" title="Metaclasses"
              accesskey="P">previous</a> |</li>
         <li><a href="index.html">Python 3 Patterns, Recipes and Idioms</a> &raquo;</li> 
       </ul>
 <p>Here&#8217;s an example that shows a little of what you can do in a Jython
 script, and also gives you a sense of performance:</p>
 <div class="highlight-python"><div class="highlight"><pre><span class="c"># Jython/Simple.py</span>
-<span class="k">import</span> <span class="nn">platform</span><span class="o">,</span> <span class="nn">glob</span><span class="o">,</span> <span class="nn">time</span>
-<span class="k">from</span> <span class="nn">subprocess</span> <span class="k">import</span> <span class="n">Popen</span><span class="p">,</span> <span class="n">PIPE</span>
+<span class="kn">import</span> <span class="nn">platform</span><span class="o">,</span> <span class="nn">glob</span><span class="o">,</span> <span class="nn">time</span>
+<span class="kn">from</span> <span class="nn">subprocess</span> <span class="kn">import</span> <span class="n">Popen</span><span class="p">,</span> <span class="n">PIPE</span>
 
 <span class="k">print</span> <span class="n">platform</span><span class="o">.</span><span class="n">uname</span><span class="p">()</span> <span class="c"># What are we running on?</span>
 <span class="k">print</span> <span class="n">glob</span><span class="o">.</span><span class="n">glob</span><span class="p">(</span><span class="s">&quot;*.py&quot;</span><span class="p">)</span> <span class="c"># Find files with .py extensions</span>
 all the directories in a directory tree, and find all the files with
 names that end in <strong>.java</strong> and contain the word <strong>PythonInterpreter</strong>:</p>
 <div class="highlight-python"><div class="highlight"><pre><span class="c"># Jython/Walk_comprehension.py</span>
-<span class="k">import</span> <span class="nn">os</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;.java&quot;</span><span class="p">)</span> <span class="ow">and</span>
 classes, create a <strong>PythonInterpreter</strong> object, and cause the Python
 files to be loaded:</p>
 <div class="highlight-java"><div class="highlight"><pre><span class="c">// Jython/GreenHouseController.java</span>
-<span class="k">import</span> <span class="nn">org.python.core.*</span><span class="o">;</span>
-<span class="k">import</span> <span class="nn">org.python.util.PythonInterpreter</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.python.core.*</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.python.util.PythonInterpreter</span><span class="o">;</span>
 
-<span class="k">public</span> <span class="k">class</span> <span class="nc">GreenHouseController</span> <span class="o">{</span>
-  <span class="k">public</span> <span class="k">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="k">throws</span> <span class="n">PyException</span>  <span class="o">{</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">GreenHouseController</span> <span class="o">{</span>
+  <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">PyException</span>  <span class="o">{</span>
     <span class="n">PythonInterpreter</span> <span class="n">interp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PythonInterpreter</span><span class="o">();</span>
     <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Loading GreenHouse Language&quot;</span><span class="o">);</span>
     <span class="n">interp</span><span class="o">.</span><span class="na">execfile</span><span class="o">(</span><span class="s">&quot;GreenHouseLanguage.py&quot;</span><span class="o">);</span>
 <div class="highlight-python"><div class="highlight"><pre><span class="c"># Jython/PythonSwing.py</span>
 <span class="c"># The HTMLButton.java example from &quot;Thinking in Java&quot;</span>
 <span class="c"># converted into Jython.</span>
-<span class="k">from</span> <span class="nn">javax.swing</span> <span class="k">import</span> <span class="n">JFrame</span><span class="p">,</span> <span class="n">JButton</span><span class="p">,</span> <span class="n">JLabel</span>
-<span class="k">from</span> <span class="nn">java.awt</span> <span class="k">import</span> <span class="n">FlowLayout</span>
+<span class="kn">from</span> <span class="nn">javax.swing</span> <span class="kn">import</span> <span class="n">JFrame</span><span class="p">,</span> <span class="n">JButton</span><span class="p">,</span> <span class="n">JLabel</span>
+<span class="kn">from</span> <span class="nn">java.awt</span> <span class="kn">import</span> <span class="n">FlowLayout</span>
 
 <span class="n">frame</span> <span class="o">=</span> <span class="n">JFrame</span><span class="p">(</span><span class="s">&quot;HTMLButton&quot;</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="mf">1</span><span class="p">,</span>
   <span class="n">defaultCloseOperation</span><span class="o">=</span><span class="n">JFrame</span><span class="o">.</span><span class="n">EXIT_ON_CLOSE</span><span class="p">)</span>
 converted into Jython:</p>
 <div class="highlight-python"><div class="highlight"><pre><span class="c"># Jython/PythonDialogs.py</span>
 <span class="c"># Dialogs.java from &quot;Thinking in Java&quot; converted into Jython.</span>
-<span class="k">from</span> <span class="nn">java.awt</span> <span class="k">import</span> <span class="n">FlowLayout</span>
-<span class="k">from</span> <span class="nn">javax.swing</span> <span class="k">import</span> <span class="n">JFrame</span><span class="p">,</span> <span class="n">JDialog</span><span class="p">,</span> <span class="n">JLabel</span>
-<span class="k">from</span> <span class="nn">javax.swing</span> <span class="k">import</span> <span class="n">JButton</span>
+<span class="kn">from</span> <span class="nn">java.awt</span> <span class="kn">import</span> <span class="n">FlowLayout</span>
+<span class="kn">from</span> <span class="nn">javax.swing</span> <span class="kn">import</span> <span class="n">JFrame</span><span class="p">,</span> <span class="n">JDialog</span><span class="p">,</span> <span class="n">JLabel</span>
+<span class="kn">from</span> <span class="nn">javax.swing</span> <span class="kn">import</span> <span class="n">JButton</span>
 
 <span class="k">class</span> <span class="nc">MyDialog</span><span class="p">(</span><span class="n">JDialog</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">parent</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
 <div class="highlight-python"><div class="highlight"><pre><span class="c"># Jython/JavaClassInPython.py</span>
 <span class="c"># Using Java classes within Jython</span>
 <span class="c"># run with: jython.bat JavaClassInPython.py</span>
-<span class="k">from</span> <span class="nn">java.util</span> <span class="k">import</span> <span class="n">Date</span><span class="p">,</span> <span class="n">HashSet</span><span class="p">,</span> <span class="n">HashMap</span>
-<span class="k">from</span> <span class="nn">Jython.javaclass</span> <span class="k">import</span> <span class="n">JavaClass</span>
-<span class="k">from</span> <span class="nn">math</span> <span class="k">import</span> <span class="n">sin</span>
+<span class="kn">from</span> <span class="nn">java.util</span> <span class="kn">import</span> <span class="n">Date</span><span class="p">,</span> <span class="n">HashSet</span><span class="p">,</span> <span class="n">HashMap</span>
+<span class="kn">from</span> <span class="nn">Jython.javaclass</span> <span class="kn">import</span> <span class="n">JavaClass</span>
+<span class="kn">from</span> <span class="nn">math</span> <span class="kn">import</span> <span class="n">sin</span>
 
 <span class="n">d</span> <span class="o">=</span> <span class="n">Date</span><span class="p">()</span> <span class="c"># Creating a Java Date object</span>
 <span class="k">print</span><span class="p">(</span><span class="n">d</span><span class="p">)</span> <span class="c"># Calls toString()</span>
 <span class="k">print</span><span class="p">(</span><span class="n">jc</span><span class="o">.</span><span class="n">val</span><span class="p">)</span>
 </pre></div>
 </div>
-<div class="admonition-todo admonition " id="todo-25">
+<div class="admonition-todo admonition " id="todo-8">
 <p class="first admonition-title">Todo</p>
 <p class="last">rewrite to distinguish python generator from above description, or
 choose different name.</p>
 module in order to be able to use the Java class. Here is the Java
 code for <strong>JavaClass</strong>:</p>
 <div class="highlight-java"><div class="highlight"><pre><span class="c">// Jython/javaclass/JavaClass.java</span>
-<span class="k">package</span> <span class="n">Jython</span><span class="o">.</span><span class="na">javaclass</span><span class="o">;</span>
-<span class="k">import</span> <span class="nn">java.util.*</span><span class="o">;</span>
+<span class="kn">package</span> <span class="n">Jython</span><span class="o">.</span><span class="na">javaclass</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">java.util.*</span><span class="o">;</span>
 
-<span class="k">public</span> <span class="k">class</span> <span class="nc">JavaClass</span> <span class="o">{</span>
-  <span class="k">private</span> <span class="n">String</span> <span class="n">s</span> <span class="o">=</span> <span class="s">&quot;&quot;</span><span class="o">;</span>
-  <span class="k">public</span> <span class="nf">JavaClass</span><span class="o">()</span> <span class="o">{</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">JavaClass</span> <span class="o">{</span>
+  <span class="kd">private</span> <span class="n">String</span> <span class="n">s</span> <span class="o">=</span> <span class="s">&quot;&quot;</span><span class="o">;</span>
+  <span class="kd">public</span> <span class="nf">JavaClass</span><span class="o">()</span> <span class="o">{</span>
     <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;JavaClass()&quot;</span><span class="o">);</span>
   <span class="o">}</span>
-  <span class="k">public</span> <span class="nf">JavaClass</span><span class="o">(</span><span class="n">String</span> <span class="n">a</span><span class="o">)</span> <span class="o">{</span>
+  <span class="kd">public</span> <span class="nf">JavaClass</span><span class="o">(</span><span class="n">String</span> <span class="n">a</span><span class="o">)</span> <span class="o">{</span>
     <span class="n">s</span> <span class="o">=</span> <span class="n">a</span><span class="o">;</span>
     <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;JavaClass(String)&quot;</span><span class="o">);</span>
   <span class="o">}</span>
-  <span class="k">public</span> <span class="n">String</span> <span class="nf">getVal</span><span class="o">()</span> <span class="o">{</span>
+  <span class="kd">public</span> <span class="n">String</span> <span class="nf">getVal</span><span class="o">()</span> <span class="o">{</span>
     <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;getVal()&quot;</span><span class="o">);</span>
     <span class="k">return</span> <span class="n">s</span><span class="o">;</span>
   <span class="o">}</span>
-  <span class="k">public</span> <span class="kt">void</span> <span class="nf">setVal</span><span class="o">(</span><span class="n">String</span> <span class="n">a</span><span class="o">)</span> <span class="o">{</span>
+  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">setVal</span><span class="o">(</span><span class="n">String</span> <span class="n">a</span><span class="o">)</span> <span class="o">{</span>
     <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;setVal()&quot;</span><span class="o">);</span>
     <span class="n">s</span> <span class="o">=</span> <span class="n">a</span><span class="o">;</span>
   <span class="o">}</span>
-  <span class="k">public</span> <span class="n">Character</span><span class="o">[]</span> <span class="n">getChars</span><span class="o">()</span> <span class="o">{</span>
+  <span class="kd">public</span> <span class="n">Character</span><span class="o">[]</span> <span class="nf">getChars</span><span class="o">()</span> <span class="o">{</span>
     <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;getChars()&quot;</span><span class="o">);</span>
     <span class="n">Character</span><span class="o">[]</span> <span class="n">r</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Character</span><span class="o">[</span><span class="n">s</span><span class="o">.</span><span class="na">length</span><span class="o">()];</span>
     <span class="k">for</span><span class="o">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">s</span><span class="o">.</span><span class="na">length</span><span class="o">();</span> <span class="n">i</span><span class="o">++)</span>
       <span class="n">r</span><span class="o">[</span><span class="n">i</span><span class="o">]</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Character</span><span class="o">(</span><span class="n">s</span><span class="o">.</span><span class="na">charAt</span><span class="o">(</span><span class="n">i</span><span class="o">));</span>
     <span class="k">return</span> <span class="n">r</span><span class="o">;</span>
   <span class="o">}</span>
-  <span class="k">public</span> <span class="k">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="o">{</span>
+  <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="o">{</span>
     <span class="n">JavaClass</span>
       <span class="n">x1</span> <span class="o">=</span> <span class="k">new</span> <span class="n">JavaClass</span><span class="o">(),</span>
       <span class="n">x2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">JavaClass</span><span class="o">(</span><span class="s">&quot;UnitTest&quot;</span><span class="o">);</span>
 <div class="highlight-java"><div class="highlight"><pre><span class="c">// Jython/PythonInterpreterSetting.java</span>
 <span class="c">// Passing data from Java to python when using</span>
 <span class="c">// the PythonInterpreter object.</span>
-<span class="k">import</span> <span class="nn">org.python.util.PythonInterpreter</span><span class="o">;</span>
-<span class="k">import</span> <span class="nn">org.python.core.*</span><span class="o">;</span>
-<span class="k">import</span> <span class="nn">java.util.*</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.python.util.PythonInterpreter</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.python.core.*</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">java.util.*</span><span class="o">;</span>
 
-<span class="k">public</span> <span class="k">class</span> <span class="nc">PythonInterpreterSetting</span> <span class="o">{</span>
-  <span class="k">public</span> <span class="k">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="k">throws</span> <span class="n">PyException</span>  <span class="o">{</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">PythonInterpreterSetting</span> <span class="o">{</span>
+  <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">PyException</span>  <span class="o">{</span>
     <span class="n">PythonInterpreter</span> <span class="n">interp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PythonInterpreter</span><span class="o">();</span>
     <span class="c">// It automatically converts Strings</span>
     <span class="c">// into native Python strings:</span>
 into a Java <strong>Map</strong>:</p>
 <div class="highlight-java"><div class="highlight"><pre><span class="c">// Jython/PyUtil.java</span>
 <span class="c">// PythonInterpreter utilities</span>
-<span class="k">import</span> <span class="nn">org.python.util.PythonInterpreter</span><span class="o">;</span>
-<span class="k">import</span> <span class="nn">org.python.core.*</span><span class="o">;</span>
-<span class="k">import</span> <span class="nn">java.util.*</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.python.util.PythonInterpreter</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.python.core.*</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">java.util.*</span><span class="o">;</span>
 
-<span class="k">public</span> <span class="k">class</span> <span class="nc">PyUtil</span> <span class="o">{</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">PyUtil</span> <span class="o">{</span>
   <span class="c">/** Extract a Python tuple or array into a Java</span>
 <span class="c">  List (which can be converted into other kinds</span>
 <span class="c">  of lists and sets inside Java).</span>
 <span class="c">  @param interp The Python interpreter object</span>
 <span class="c">  @param pyName The id of the python list object</span>
 <span class="c">  */</span>
-  <span class="k">public</span> <span class="k">static</span> <span class="n">List</span>
+  <span class="kd">public</span> <span class="kd">static</span> <span class="n">List</span>
   <span class="nf">toList</span><span class="o">(</span><span class="n">PythonInterpreter</span> <span class="n">interp</span><span class="o">,</span> <span class="n">String</span> <span class="n">pyName</span><span class="o">){</span>
     <span class="k">return</span> <span class="k">new</span> <span class="nf">ArrayList</span><span class="o">(</span><span class="n">Arrays</span><span class="o">.</span><span class="na">asList</span><span class="o">(</span>
       <span class="o">(</span><span class="n">Object</span><span class="o">[])</span><span class="n">interp</span><span class="o">.</span><span class="na">get</span><span class="o">(</span>
 <span class="c">  @param interp The Python interpreter object</span>
 <span class="c">  @param pyName The id of the python dictionary</span>
 <span class="c">  */</span>
-  <span class="k">public</span> <span class="k">static</span> <span class="n">Map</span>
+  <span class="kd">public</span> <span class="kd">static</span> <span class="n">Map</span>
   <span class="nf">toMap</span><span class="o">(</span><span class="n">PythonInterpreter</span> <span class="n">interp</span><span class="o">,</span> <span class="n">String</span> <span class="n">pyName</span><span class="o">){</span>
     <span class="n">PyList</span> <span class="n">pa</span> <span class="o">=</span> <span class="o">((</span><span class="n">PyDictionary</span><span class="o">)</span><span class="n">interp</span><span class="o">.</span><span class="na">get</span><span class="o">(</span>
       <span class="n">pyName</span><span class="o">)).</span><span class="na">items</span><span class="o">();</span>
 <span class="c">  suitable for placing into a PythonInterpreter</span>
 <span class="c">  @param map The Java Map object</span>
 <span class="c">  */</span>
-  <span class="k">public</span> <span class="k">static</span> <span class="n">PyDictionary</span> <span class="nf">toPyDictionary</span><span class="o">(</span><span class="n">Map</span> <span class="n">map</span><span class="o">)</span> <span class="o">{</span>
+  <span class="kd">public</span> <span class="kd">static</span> <span class="n">PyDictionary</span> <span class="nf">toPyDictionary</span><span class="o">(</span><span class="n">Map</span> <span class="n">map</span><span class="o">)</span> <span class="o">{</span>
     <span class="n">Map</span> <span class="n">m</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o">();</span>
     <span class="n">Iterator</span> <span class="n">it</span> <span class="o">=</span> <span class="n">map</span><span class="o">.</span><span class="na">entrySet</span><span class="o">().</span><span class="na">iterator</span><span class="o">();</span>
     <span class="k">while</span><span class="o">(</span><span class="n">it</span><span class="o">.</span><span class="na">hasNext</span><span class="o">())</span> <span class="o">{</span>
 </div>
 <p>Here is the unit testing code:</p>
 <div class="highlight-java"><div class="highlight"><pre><span class="c">// Jython/TestPyUtil.java</span>
-<span class="k">import</span> <span class="nn">org.python.util.PythonInterpreter</span><span class="o">;</span>
-<span class="k">import</span> <span class="nn">java.util.*</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.python.util.PythonInterpreter</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">java.util.*</span><span class="o">;</span>
 
-<span class="k">public</span> <span class="k">class</span> <span class="nc">TestPyUtil</span> <span class="o">{</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">TestPyUtil</span> <span class="o">{</span>
   <span class="n">PythonInterpreter</span> <span class="n">pi</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PythonInterpreter</span><span class="o">();</span>
-  <span class="k">public</span> <span class="kt">void</span> <span class="nf">test1</span><span class="o">()</span> <span class="o">{</span>
+  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">test1</span><span class="o">()</span> <span class="o">{</span>
     <span class="n">pi</span><span class="o">.</span><span class="na">exec</span><span class="o">(</span><span class="s">&quot;tup=(&#39;fee&#39;,&#39;fi&#39;,&#39;fo&#39;,&#39;fum&#39;,&#39;fi&#39;)&quot;</span><span class="o">);</span>
     <span class="n">List</span> <span class="n">lst</span> <span class="o">=</span> <span class="n">PyUtil</span><span class="o">.</span><span class="na">toList</span><span class="o">(</span><span class="n">pi</span><span class="o">,</span> <span class="s">&quot;tup&quot;</span><span class="o">);</span>
     <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">lst</span><span class="o">);</span>
     <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="k">new</span> <span class="n">HashSet</span><span class="o">(</span><span class="n">lst</span><span class="o">));</span>
   <span class="o">}</span>
-  <span class="k">public</span> <span class="kt">void</span> <span class="nf">test2</span><span class="o">()</span> <span class="o">{</span>
+  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">test2</span><span class="o">()</span> <span class="o">{</span>
     <span class="n">pi</span><span class="o">.</span><span class="na">exec</span><span class="o">(</span><span class="s">&quot;ints=[1,3,5,7,9,11,13,17,19]&quot;</span><span class="o">);</span>
     <span class="n">List</span> <span class="n">lst</span> <span class="o">=</span> <span class="n">PyUtil</span><span class="o">.</span><span class="na">toList</span><span class="o">(</span><span class="n">pi</span><span class="o">,</span> <span class="s">&quot;ints&quot;</span><span class="o">);</span>
     <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">lst</span><span class="o">);</span>
   <span class="o">}</span>
-  <span class="k">public</span> <span class="kt">void</span> <span class="nf">test3</span><span class="o">()</span> <span class="o">{</span>
+  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">test3</span><span class="o">()</span> <span class="o">{</span>
     <span class="n">pi</span><span class="o">.</span><span class="na">exec</span><span class="o">(</span><span class="s">&quot;dict = { 1 : &#39;a&#39;, 3 : &#39;b&#39;, &quot;</span> <span class="o">+</span>
       <span class="s">&quot;5 : &#39;c&#39;, 9 : &#39;d&#39;, 11 : &#39;e&#39;}&quot;</span><span class="o">);</span>
     <span class="n">Map</span> <span class="n">mp</span> <span class="o">=</span> <span class="n">PyUtil</span><span class="o">.</span><span class="na">toMap</span><span class="o">(</span><span class="n">pi</span><span class="o">,</span> <span class="s">&quot;dict&quot;</span><span class="o">);</span>
     <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">mp</span><span class="o">);</span>
   <span class="o">}</span>
-  <span class="k">public</span> <span class="kt">void</span> <span class="nf">test4</span><span class="o">()</span> <span class="o">{</span>
+  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">test4</span><span class="o">()</span> <span class="o">{</span>
     <span class="n">Map</span> <span class="n">m</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o">();</span>
     <span class="n">m</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">&quot;twas&quot;</span><span class="o">,</span> <span class="k">new</span> <span class="n">Integer</span><span class="o">(</span><span class="mi">11</span><span class="o">));</span>
     <span class="n">m</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">&quot;brillig&quot;</span><span class="o">,</span> <span class="k">new</span> <span class="n">Integer</span><span class="o">(</span><span class="mi">27</span><span class="o">));</span>
     <span class="n">pi</span><span class="o">.</span><span class="na">exec</span><span class="o">(</span><span class="s">&quot;print(m)&quot;</span><span class="o">);</span>
     <span class="n">pi</span><span class="o">.</span><span class="na">exec</span><span class="o">(</span><span class="s">&quot;print(m[&#39;slithy&#39;])&quot;</span><span class="o">);</span>
   <span class="o">}</span>
-  <span class="k">public</span> <span class="k">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="o">(</span><span class="n">String</span> <span class="n">args</span><span class="o">[])</span> <span class="o">{</span>
+  <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="o">(</span><span class="n">String</span> <span class="n">args</span><span class="o">[])</span> <span class="o">{</span>
     <span class="n">TestPyUtil</span> <span class="n">test</span> <span class="o">=</span> <span class="k">new</span> <span class="n">TestPyUtil</span><span class="o">();</span>
     <span class="n">test</span><span class="o">.</span><span class="na">test1</span><span class="o">();</span>
     <span class="n">test</span><span class="o">.</span><span class="na">test2</span><span class="o">();</span>
 code:</p>
 <div class="highlight-java"><div class="highlight"><pre><span class="c">// Jython/PythonInterpreterGetting.java</span>
 <span class="c">// Getting data from the PythonInterpreter object.</span>
-<span class="k">import</span> <span class="nn">org.python.util.PythonInterpreter</span><span class="o">;</span>
-<span class="k">import</span> <span class="nn">org.python.core.*</span><span class="o">;</span>
-<span class="k">import</span> <span class="nn">java.util.*</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.python.util.PythonInterpreter</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.python.core.*</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">java.util.*</span><span class="o">;</span>
 
-<span class="k">public</span> <span class="k">class</span> <span class="nc">PythonInterpreterGetting</span> <span class="o">{</span>
-  <span class="k">public</span> <span class="k">static</span> <span class="kt">void</span>
-  <span class="nf">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="k">throws</span> <span class="n">PyException</span>  <span class="o">{</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">PythonInterpreterGetting</span> <span class="o">{</span>
+  <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span>
+  <span class="nf">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">PyException</span>  <span class="o">{</span>
     <span class="n">PythonInterpreter</span> <span class="n">interp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PythonInterpreter</span><span class="o">();</span>
     <span class="n">interp</span><span class="o">.</span><span class="na">exec</span><span class="o">(</span><span class="s">&quot;a = 100&quot;</span><span class="o">);</span>
     <span class="c">// If you just use the ordinary get(),</span>
 <div class="highlight-java"><div class="highlight"><pre><span class="c">// Jython/MultipleJythons.java</span>
 <span class="c">// You can run multiple interpreters, each</span>
 <span class="c">// with its own name space.</span>
-<span class="k">import</span> <span class="nn">org.python.util.PythonInterpreter</span><span class="o">;</span>
-<span class="k">import</span> <span class="nn">org.python.core.*</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.python.util.PythonInterpreter</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.python.core.*</span><span class="o">;</span>
 
-<span class="k">public</span> <span class="k">class</span> <span class="nc">MultipleJythons</span> <span class="o">{</span>
-  <span class="k">public</span> <span class="k">static</span> <span class="kt">void</span>
-  <span class="nf">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="k">throws</span> <span class="n">PyException</span>  <span class="o">{</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">MultipleJythons</span> <span class="o">{</span>
+  <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span>
+  <span class="nf">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">PyException</span>  <span class="o">{</span>
     <span class="n">PythonInterpreter</span>
       <span class="n">interp1</span> <span class="o">=</span>  <span class="k">new</span> <span class="n">PythonInterpreter</span><span class="o">(),</span>
       <span class="n">interp2</span> <span class="o">=</span>  <span class="k">new</span> <span class="n">PythonInterpreter</span><span class="o">();</span>
 above Python code. You can&#8217;t compile <strong>TestPythonToJavaClass.java</strong>
 until <strong>PythonToJavaClass.class</strong> is available:</p>
 <div class="highlight-java"><div class="highlight"><pre><span class="c">// Jython/TestPythonToJavaClass.java</span>
-<span class="k">import</span> <span class="nn">java.lang.reflect.*</span><span class="o">;</span>
-<span class="k">import</span> <span class="nn">java.util.*</span><span class="o">;</span>
-<span class="k">import</span> <span class="nn">org.python.core.*</span><span class="o">;</span>
-<span class="k">import</span> <span class="nn">java.util.*</span><span class="o">;</span>
-<span class="k">import</span> <span class="nn">net.mindview.python.*</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">java.lang.reflect.*</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">java.util.*</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.python.core.*</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">java.util.*</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">net.mindview.python.*</span><span class="o">;</span>
 <span class="c">// The package with the Python-generated classes:</span>
-<span class="k">import</span> <span class="nn">python.java.test.*</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">python.java.test.*</span><span class="o">;</span>
 
-<span class="k">public</span> <span class="k">class</span> <span class="nc">TestPythonToJavaClass</span> <span class="o">{</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">TestPythonToJavaClass</span> <span class="o">{</span>
   <span class="n">PythonToJavaClass</span> <span class="n">p2j</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PythonToJavaClass</span><span class="o">();</span>
-  <span class="k">public</span> <span class="kt">void</span> <span class="nf">testDumpClassInfo</span><span class="o">()</span> <span class="o">{</span>
+  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">testDumpClassInfo</span><span class="o">()</span> <span class="o">{</span>
     <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span>
       <span class="n">Arrays</span><span class="o">.</span><span class="na">toString</span><span class="o">(</span>
         <span class="n">p2j</span><span class="o">.</span><span class="na">getClass</span><span class="o">().</span><span class="na">getConstructors</span><span class="o">()));</span>
         <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">nm</span><span class="o">);</span>
     <span class="o">}</span>
   <span class="o">}</span>
-  <span class="k">public</span> <span class="k">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="o">{</span>
+  <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="o">{</span>
     <span class="n">p2j</span><span class="o">.</span><span class="na">simple</span><span class="o">();</span>
     <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">p2j</span><span class="o">.</span><span class="na">returnString</span><span class="o">());</span>
     <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span>
 
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="CoroutinesAndConcurrency.html" title="previous chapter">Coroutines &amp; Concurrency</a></p>
+            <p class="topless"><a href="Metaclasses.html"
+                                  title="previous chapter">Metaclasses</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="Part2.html" title="next chapter">Part II: Idioms</a></p>
+            <p class="topless"><a href="Part2.html"
+                                  title="next chapter">Part II: Idioms</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
-              <li><a href="_sources/Jython.txt" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/Jython.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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>
           <a href="Part2.html" title="Part II: Idioms"
              accesskey="N">next</a> |</li>
         <li class="right" >
-          <a href="CoroutinesAndConcurrency.html" title="Coroutines &amp; Concurrency"
+          <a href="Metaclasses.html" title="Metaclasses"
              accesskey="P">previous</a> |</li>
         <li><a href="index.html">Python 3 Patterns, Recipes and Idioms</a> &raquo;</li> 
       </ul>
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 31, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </div>
   </body>

html/LanguageChanges.html

 <!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">
+  "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" />
     
     <link rel="search" title="Search" href="search.html" />
     <link rel="top" title="Python 3 Patterns, Recipes and Idioms" href="index.html" />
     <link rel="next" title="Decorators" href="PythonDecorators.html" />
-    <link rel="prev" title="Unit Testing &amp; Test-Driven Development" href="UnitTesting.html" /> 
+    <link rel="prev" title="Unit Testing & Test-Driven Development" href="UnitTesting.html" /> 
   </head>
   <body>
     <div class="related">
           <a href="PythonDecorators.html" title="Decorators"
              accesskey="N">next</a> |</li>
         <li class="right" >
-          <a href="UnitTesting.html" title="Unit Testing &amp; Test-Driven Development"
+          <a href="UnitTesting.html" title="Unit Testing & Test-Driven Development"
              accesskey="P">previous</a> |</li>
         <li><a href="index.html">Python 3 Patterns, Recipes and Idioms</a> &raquo;</li> 
       </ul>
     
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="UnitTesting.html" title="previous chapter">Unit Testing &amp; Test-Driven Development</a></p>
+            <p class="topless"><a href="UnitTesting.html"
+                                  title="previous chapter">Unit Testing &amp; Test-Driven Development</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="PythonDecorators.html" title="next chapter">Decorators</a></p>
+            <p class="topless"><a href="PythonDecorators.html"
+                                  title="next chapter">Decorators</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
-              <li><a href="_sources/LanguageChanges.txt" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/LanguageChanges.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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>
           <a href="PythonDecorators.html" title="Decorators"
              accesskey="N">next</a> |</li>
         <li class="right" >
-          <a href="UnitTesting.html" title="Unit Testing &amp; Test-Driven Development"
+          <a href="UnitTesting.html" title="Unit Testing & Test-Driven Development"
              accesskey="P">previous</a> |</li>
         <li><a href="index.html">Python 3 Patterns, Recipes and Idioms</a> &raquo;</li> 
       </ul>
     </div>
     <div class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 26, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </div>
   </body>

html/MachineDiscovery.html

 <!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">
+  "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" />
     
     
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="Part2.html" title="previous chapter">Part II: Idioms</a></p>
+            <p class="topless"><a href="Part2.html"
+                                  title="previous chapter">Part II: Idioms</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="CanonicalScript.html" title="next chapter">A Canonical Form for Command-Line Programs</a></p>
+            <p class="topless"><a href="CanonicalScript.html"
+                                  title="next chapter">A Canonical Form for Command-Line Programs</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
-              <li><a href="_sources/MachineDiscovery.txt" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/MachineDiscovery.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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 class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 26, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </div>
   </body>

html/Messenger.html

 <!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">
+  "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" />
     
     
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="CanonicalScript.html" title="previous chapter">A Canonical Form for Command-Line Programs</a></p>
+            <p class="topless"><a href="CanonicalScript.html"
+                                  title="previous chapter">A Canonical Form for Command-Line Programs</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="Part3.html" title="next chapter">Part III: Patterns</a></p>
+            <p class="topless"><a href="Part3.html"
+                                  title="next chapter">Part III: Patterns</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
-              <li><a href="_sources/Messenger.txt" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/Messenger.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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 class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 26, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </div>
   </body>

html/MultipleDispatching.html

 <!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">
+  "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" />
     
 <p>Here&#8217;s an example of multiple dispatching:</p>
 <div class="highlight-python"><div class="highlight"><pre><span class="c"># MultipleDispatching/PaperScissorsRock.py</span>
 <span class="c"># Demonstration of multiple dispatching.</span>
-<span class="k">from</span> <span class="nn">__future__</span> <span class="k">import</span> <span class="n">generators</span>
-<span class="k">import</span> <span class="nn">random</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="c"># An enumeration type:</span>
 <span class="k">class</span> <span class="nc">Outcome</span><span class="p">:</span>
 like this:</p>
 <div class="highlight-python"><div class="highlight"><pre><span class="c"># MultipleDispatching/PaperScissorsRock2.py</span>
 <span class="c"># Multiple dispatching using a table</span>
-<span class="k">from</span> <span class="nn">__future__</span> <span class="k">import</span> <span class="n">generators</span>
-<span class="k">import</span> <span class="nn">random</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="k">class</span> <span class="nc">Outcome</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">value</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span>
     
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="Observer.html" title="previous chapter">Observer</a></p>
+            <p class="topless"><a href="Observer.html"
+                                  title="previous chapter">Observer</a></p>
             <h4>Next topic</h4>
-            <p class="topless"><a href="Visitor.html" title="next chapter">Visitor</a></p>
+            <p class="topless"><a href="Visitor.html"
+                                  title="next chapter">Visitor</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
-              <li><a href="_sources/MultipleDispatching.txt" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/MultipleDispatching.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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 class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 26, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </div>
   </body>

html/NoteToReaders.html

 <!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">
+  "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" />
     
     
 
             <h4>Previous topic</h4>
-            <p class="topless"><a href="ToDo.html" title="previous chapter">ToDo List</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>
+            <p class="topless"><a href="Introduction.html"
+                                  title="next chapter">Introduction</a></p>
             <h3>This Page</h3>
             <ul class="this-page-menu">
-              <li><a href="_sources/NoteToReaders.txt" rel="nofollow">Show Source</a></li>
+              <li><a href="_sources/NoteToReaders.txt"
+                     rel="nofollow">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>
-            <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+	  <div id="searchbox" style="display: none">
+            <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>
+	      <p style="font-size: 90%">Enter search terms or a module, class or function name.</p>
+          </div>
+          <script type="text/javascript">$('#searchbox').show(0);</script>
     <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 class="footer">
       &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
-      Last updated on Dec 26, 2008.
+      Last updated on Jan 22, 2009.
       Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.
     </div>
   </body>

html/Observer.html

 <!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">
+  "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" />
     
 code like this:</p>
 <div class="highlight-python"><div class="highlight"><pre><span class="c"># Util/ToSynch.py</span>
 
-<span class="k">import</span> <span class="nn">threading</span>
+<span class="kn">import</span> <span class="nn">threading</span>
 <span class="k">class</span> <span class="nc">ToSynch</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="bp">self</span><span class="o">.</span><span class="n">mutex</span> <span class="o">=</span> <span class="n">threading</span><span class="o">.</span><span class="n">RLock</span><span class="p">()</span>
 <div class="highlight-python"><div class="highlight"><pre><span class="c"># Util/Synchronization.py</span>
 <span class="sd">&#39;&#39;&#39;Simple emulation of Java&#39;s &#39;synchronized&#39;</span>
 <span class="sd">keyword, from Peter Norvig.&#39;&#39;&#39;</span>
-<span class="k">import</span> <span class="nn">threading</span>
+<span class="kn">import</span> <span class="nn">threading</span>
 
 <span class="k">def</span> <span class="nf">synchronized</span><span class="p">(</span><span class="n">method</span><span class="p">):</span>
     <span class="k">def</span> <span class="nf">f</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">):</span>
 <strong>Synchronization</strong> is provided.</p>
 <p>Here&#8217;s a simple test of the <strong>Synchronization</strong> module:</p>
 <div class="highlight-python"><div class="highlight"><pre><span class="c"># Util/TestSynchronization.py</span>
-<span class="k">from</span> <span class="nn">Synchronization</span> <span class="k">import</span> <span class="o">*</span>
+<span class="kn">from</span> <span class="nn">Synchronization</span> <span class="kn">import</span> <span class="o">*</span>
 
 <span class="c"># To use for a method:</span>
 <span class="k">class</span> <span class="nc">C</span><span class="p">(</span><span class="n">Synchronization</span><span class="p">):</span>
 a fix for this]:</p>
 <div class="highlight-python"><div class="highlight"><pre><span class="c"># Util/Observer.py</span>
 <span class="c"># Class support for &quot;observer&quot; pattern.</span>
-<span class="k">from</span> <span class="nn">Synchronization</span> <span class="k">import</span> <span class="o">*</span>
+<span class="kn">from</span> <span class="nn">Synchronization</span> <span class="kn">import</span> <span class="o">*</span>
 
 <span class="k">class</span> <span class="nc">Observer</span><span class="p">:</span>
     <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="n">observable</span><span class="p">,</span> <span class="n">arg</span><span class="p">):</span>
 <span class="sd">Install PythonCard. See:</span>
 <span class="sd">http://pythoncard.sourceforge.net</span>
 <span class="sd">&quot;&quot;&quot;</span>
-<span class="k">from</span> <span class="nn">PythonCardPrototype</span> <span class="k">import</span> <span class="n">log</span><span class="p">,</span> <span class="n">model</span>
-<span class="k">import</span> <span class="nn">random</span>
+&l