Python is readable

Arnaud Delobelle arnodel at gmail.com
Fri Mar 16 00:00:23 CET 2012


On 15 March 2012 22:35, Ben Finney <ben+python at benfinney.id.au> wrote:
> Kiuhnm <kiuhnm03.4t.yahoo.it> writes:
>
>> Moreover, I think that
>>   if (............
>>       ............
>>       ............):
>>       ............
>>       ............
>>       ............
>> is not very readable anyway.
>
> I agree, and am glad PEP 8 has been updated to recommend an extra level
> of indentation for continuation, to distinguish from the new block that
> follows <URL:http://www.python.org/dev/peps/pep-0008/#indentation>.

Personally I solve this by never writing if conditions that span more
than one line.  If the worst comes to the worst, I would write:

aptly_named_condition = (
    very long condition
    that goes over
    plenty of lines
)
if aptly_named_condition:
    do stuff

-- 
Arnaud



More information about the Python-list mailing list