raising exceptions issue
<p>here is my code:</p>

<pre><code>class longInputException(Exception):
    def __init__(self, length, max):
        Exception.__init__(self)
        self.length = len(length)
        self.max = max

try:
    max = 3
    s = raw_input('Enter something--&gt;')
    if len(s) &gt; max:
        raise longInputException(s, max)

except longInputException, x:
    print 'longInputException: the input was of length %d, \
was expecting less than or equal to %d' % (x.length, x.max)

else:
    print 'No exception was raised.'
</code></pre>

<p>What I don't understand is why <code>x</code> is used in the <code>longInputException</code>'s <code>except</code> statement. why not just used <code>self</code> in the substitution tuple?</p>
