
Can we start a new thread just for discussion of PEP-3150? I personally don't like any of the proposals to add assignment to list comprehensions/generator expressions and I think that no matter how it's spelt the idea is a misfeature since there's no need to cram more info into a one-liner list comp/gen ex, but I do find the given-clause very interesting and potentially useful. In terms of positives for the feature, assignment in a list comp/gen ex has the potential to save a few characters and maybe be more readable (although I haven't seen any proposal that strikes me as more readable yet), but PEP-3150 has the four different benefits listed previously by Nick, most notably that it creates a temporary namespace (a honking great idea!). So, it strikes me that the two issues are different enough that it might be useful to separate the discussions out.

I hadn't realized that the given syntax has been floated for years: http://mail.python.org/pipermail/python-dev/2005-October/057409.html -eric

On Fri, Apr 15, 2011 at 4:32 PM, Eric Snow <ericsnowcurrently@gmail.com> wrote:
I hadn't realized that the given syntax has been floated for years: http://mail.python.org/pipermail/python-dev/2005-October/057409.html
Yep, that's the main reason I wrote PEP 3150 - so I didn't need to go digging for old emails on the topic every time it came up :) (with requests for multi-line lambdas being a common entry point into the discussion!) Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia

I hadn't realized that the given syntax has been floated for years: http://mail.python.org/pipermail/python-dev/2005-October/057409.html -eric

On Fri, Apr 15, 2011 at 4:32 PM, Eric Snow <ericsnowcurrently@gmail.com> wrote:
I hadn't realized that the given syntax has been floated for years: http://mail.python.org/pipermail/python-dev/2005-October/057409.html
Yep, that's the main reason I wrote PEP 3150 - so I didn't need to go digging for old emails on the topic every time it came up :) (with requests for multi-line lambdas being a common entry point into the discussion!) Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
participants (3)
-
Carl M. Johnson
-
Eric Snow
-
Nick Coghlan