[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-ideas
Subject:    Re: [Python-ideas] New 3.x restriction in list comprehensions
From:       Nick Coghlan <ncoghlan () gmail ! com>
Date:       2010-09-18 7:39:11
Message-ID: AANLkTik_=ZkQh+ZJ6WgiXN_atpH9s1dMyN4SN+bB8V88 () mail ! gmail ! com
[Download RAW message or body]

On Sat, Sep 18, 2010 at 8:00 AM, Dirkjan Ochtman <dirkjan@ochtman.nl> wrote:
> On Fri, Sep 17, 2010 at 21:44, Raymond Hettinger
> <raymond.hettinger@gmail.com> wrote:
>> My question for the group is whether it would be a good
>> idea to drop the new restriction.
>
> I like the restriction and would actually advocate having it for
> regular for-loops too (though that would be a big no-no, I guess).

Yep, I tend to parenthesise tuples even when it isn't strictly
necessary as well. Even if the parser doesn't care, it makes it a lot
easier for human readers (including myself when I have to go back and
read that code). (I have similar objections to people that rely on
precedence ordering too heavily in complicated expressions - even if
the compiler understands them correctly, many readers won't know the
precedence table off by heart. Judicious use of parentheses turns code
those readers would otherwise have to think about into something which
is obviously correct even at a glance).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan@gmail.com   |   Brisbane, Australia
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
http://mail.python.org/mailman/listinfo/python-ideas

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic