Are Python's reserved words reserved in places they dont need to be?

Andrew McLean andrew-news at andros.org.uk
Thu Sep 14 20:03:18 EDT 2006


Roy Smith wrote:
> 
> As I remember, you didn't need the whitespace either. IIRC, your example 
> above could have been written as:
> 
>       PROGRAMKWDS
>       REALREAL,WRITE
>       WRITE=1.0
>       REAL=2.0
>       WRITE(*,*)WRITE,REAL
>       END
> 

It's stranger than that. FORTRAN 77 is insensitive to white space (other 
than inside character literals).

So you could write the code like:

        P  RO  G  RAM KW D                                  S
        RE  ALRE  AL, WRITE
                      WRITE = 1  .  0
        RE  AL=2.0
        WRI TE(*  ,  *)WRI  TE, REAL
        E             N               D

if you wanted to ;-)

When people complain that Python is sensitive to white space, remember 
this as the opposite extreme!

[Just for completeness I will add that there are rules about what 
"columns" the code has to be in, but that is separate from the white 
space issue.]



More information about the Python-list mailing list