Python statements not forcing whitespace is messy?
James Stroud
jstroud at mbi.ucla.edu
Sat Sep 15 15:48:37 EDT 2007
buffi wrote:
> Am I the only one that thinks that python statements should force
> whitespace before and after them?
>
> Right now this is not enforced and for an example these statements are
> valid
>
> print"hello"
> "foo"if"bar"else"foobar"
> for(x,y)in[(1,2),(3,4)]:print(x,y)
> [(y)for(x,y)in[("foo",2),("bar",4)]if"foo"in(x)]
>
> ...and so on.
>
> I know that writing code like this really shouldn't be done but
> wouldn't it be a good idea to enforce the use of whitespace around
> statements?
>
> (I wrote a short blog post about this here http://blog.buffis.com/?p=55
> but thought I would post here as well to see what other developers
> think)
> - Björn Kempén
>
You may have a point--but on the other hand, this may be purposefully
allowed help to recruit perl programmers.
James
More information about the Python-list
mailing list