PEP8 compliance and exception messages ?

Gerald Britton gerald.britton at gmail.com
Wed Dec 8 13:39:45 EST 2010


I'm a bit late to the discussion, but remembering that raise takes an
expression, I can break it up like this:

>>> raise (
... Exception (
... "Long "
... "exception "
... "text."
... )
... )
Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
Exception: Long exception text

Then, you can indent the individual lines any way you like.
-- 
Gerald Britton



More information about the Python-list mailing list