[Python-ideas] 80 character line width vs. something wider

Ben Finney ben+python at benfinney.id.au
Wed May 20 11:40:31 CEST 2009


spir <denis.spir at free.fr> writes:

>             try:
>                 my_final_result = finalResultComputer(arg1_from_abunch_of_args,
>                                                       args_should_align_properly,
>                                                       [so, what, if, they, re, compound])
>             except AttributeError, error:
>                 raise computeError( "foo .........         bar"
>                                     "<--All message text lines should start here."
>                                     %(String, interpolation, argument, list, as, well) )

It's for this reason that I advocate indenting continued lines *one*
level, and not this hideously large increase in indentation for a single
step.

Simply break at the opening container character, and indent a single
level to make all the contents line up::

    try:
        my_final_result = finalResultComputer(
            arg1_from_abunch_of_args,
            args_should_align_properly,
            [so, what, if, they, re, compound])
    except AttributeError, error:
        raise computeError(
            "foo .........         bar"
            "<--All message text lines should start here."
            % (String, interpolation, argument, list, as, well))

-- 
 \      “I put instant coffee in a microwave oven and almost went back |
  `\                                          in time.” —Steven Wright |
_o__)                                                                  |
Ben Finney




More information about the Python-ideas mailing list