Tabs -vs- Spaces: Tabs should have won.

Ben Finney ben+python at benfinney.id.au
Mon Jul 18 03:42:12 CEST 2011


Steven D'Aprano <steve+comp.lang.python at pearwood.info> writes:

> The exception is, you have an indented block of code, perhaps three or four
> indents deep (surely you never allow anything to get beyond five or six
> indents?), and you want to raise an exception:
>
>                 raise SomeExceptionType("and here's a rather long error"
>                                         "message blah blah blah")

Give yourself plenty more room, stay within PEP 8, *and* make the
alignment robust in the face of changes::

                raise SomeExceptionType(
                        "and here's a rather long error"
                        "message blah blah blah")

-- 
 \           “I have one rule to live by: Don't make it worse.” —Hazel |
  `\                                                          Woodcock |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list