String Exceptions (PEP 352)

bruno at modulix onurb at xiludom.gro
Thu Apr 27 10:40:46 EDT 2006


Thomas Guettler wrote:
> Hi,
> 
> I like python because it is compatible to old versions. That's way I think
> string exceptions should not be deprecated.
> 
> I use string exceptions if the condition for an assertion is
> to complex:
> 
> if foo and bar and i>10:
>     raise "if foo and bar i must not be greater than 10"

What's wrong with:

assert foo and bar and i > 10, \
  "if foo and bar i must not be greater than 10"



(snip)
>
> Please keep Python compatible to old versions.

<MHO>
When there's too much hysterical cruft and warts accumulated from the
past, it's time to throw away and clean up, even if it breaks a lot of
things. Trying to keep compatibility at any price would be just suicidal
IMHO - time to get rid of old warts and come back to simplicity. "one
obvious way to do it" rules.
</MHO>

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list