allow line break at operators

Tim Roberts timr at probo.com
Mon Aug 15 01:22:21 EDT 2011


Steven D'Aprano <steve+comp.lang.python at pearwood.info> wrote:
>
>The only exception I can think of is *very* early Fortran, and that rightly
>is considered a mistake. Fortran 77 used to treat whitespace as always
>optional, so that in Python terms this:
>
>forxinrange(42)
>
>would be parsed as this:
>
>for x in range(42)

Absolutely true, and that led to one of the more famous computing screw-ups
in the early space program.  The author intended to write this:
      DO 10 I=1,8
which, in Fortran, begins a loop that will run 8 times ending at the
statement labeled "10".  In this case, the author mistakenly typed a period
instead of a comma:
      DO 10 I=1.8

That, unfortunately, is a perfectly valid statement that assigns the value
"1.8" to the floating point variable "DO10I", supposedly resulting in the
loss of an unmanned launch vehicle...
-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-list mailing list