title: name 'OptionGroup' is not defined
body: <p>This error is done strictly by following <a href="http://docs.python.org/library/optparse.html#generating-help" rel="nofollow noreferrer">examples found on the docs</a>. And you can't find any clarification about it anywhere, be it <a href="http://docs.python.org/library/optparse.html#tutorial" rel="nofollow noreferrer">that long long docs page</a>, <a href="http://www.google.com/search?q=python+%22name+&#39;OptionGroup&#39;+is+not+defined%22" rel="nofollow noreferrer">google</a> or <a href="https://stackoverflow.com/search?q=optiongroup+%5Bpython%5D">stackoverflow</a>. Plus, reading <code>optparse.py</code> shows OptionGroup is there, so that adds to the confusion.</p>
  
  <pre><code>Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) 
  &gt;&gt;&gt; from optparse import OptionParser
  &gt;&gt;&gt; outputGroup = OptionGroup(parser, 'Output handling')
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  NameError: name 'OptionGroup' is not defined
  </code></pre>
  
  <p>I bet it will take less than 1 minute for someone to spot my error. :)</p>
  
  <p>Yes, that means I knew the answer, but since this took me so long to discover I wanted to "document" it here.</p>