Python is readable

Kiuhnm kiuhnm03.4t.yahoo.it
Thu Mar 15 15:55:05 CET 2012


On 3/15/2012 15:28, Tim Golden wrote:
> On 15/03/2012 14:19, Kiuhnm wrote:
>> On 3/15/2012 15:06, Mark Lawrence wrote:
>>> On 15/03/2012 11:48, Kiuhnm wrote:
>>>> BTW, aren't those ':' redundant?
>>>>
>>>> Kiuhnm
>>>
>>> Nope.
>>>
>>> Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit
>>> (Intel)] on win32
>>> Type "help", "copyright", "credits" or "license" for more information.
>>> >>> with open("filename", "w") as f
>>> File "<stdin>", line 1
>>> with open("filename", "w") as f
>>> ^
>>> SyntaxError: invalid syntax
>>
>> Ok, so they're mandatory, but I was mainly talking of design. Why are
>> they needed?
>>
>> Kiuhnm
>
> http://docs.python.org/faq/design.html#why-are-colons-required-for-the-if-while-def-class-statements

The second one is slightly easier to read because it's 
syntax-highlighted. Was that on purpose?
By the way, the more elaborate parsing consists of looking for an 
END_OF_LINE followed by one or more spaces. It doesn't sound that 
complicated.
And what about an editor which indent when you press the spacebar or tab?

Kiuhnm



More information about the Python-list mailing list