Python is readable

Tim Golden mail at timgolden.me.uk
Thu Mar 15 15:28:38 CET 2012


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

TJG



More information about the Python-list mailing list