For review: PEP 308 - If-then-else expression
Alex Martelli
aleax at aleax.it
Sun Feb 9 14:42:46 EST 2003
Carlos Ribeiro wrote:
> On Saturday 08 February 2003 18:51, Christian Tismer wrote:
>> b) reading and execution order should match as much as possible.
>
> Then I wonder why do people think that the following snippet is pythonic
> in any (reasonable) way:
>
> ','.join(lines)
>
> In what direction does it reads?
Left to right:
From the literal string object ',',
fetch the attribute named 'join',
prepare the value of the variable named 'lines' as the argument,
and execute the attribute (must be a method) with the argument.
Alex
More information about the Python-list
mailing list