Python is readable

Chris Angelico rosuav at gmail.com
Thu Mar 15 10:48:09 EDT 2012


On Fri, Mar 16, 2012 at 1:30 AM, Kiuhnm
<kiuhnm03.4t.yahoo.it at mail.python.org> wrote:
> Sorry, but I can't see how it would make it harder for humans to understand.
> Are there particular situations you're referring to?

In a trivial example, it's mostly just noise:

if a == b    # who needs the colon?
    print(c)

But when your condition is more complicated, it's cleaner to
explicitly mark the end of the condition. Also, Python allows you to
put a simple body on the same line as the if, which is very handy:

if a == b: print(c)

Without the colon, this would be awkward to parse. And the bash style
of using actual statement separators feels really weird, although it
does mean that the newline is truly optional.

ChrisA



More information about the Python-list mailing list