[Python-Dev] Informal educator feedback on PEP 572 (was Re: 2018 Python Language Summit coverage, last part) (original) (raw)
Nick Coghlan ncoghlan at gmail.com
Sat Jun 30 04:30:56 EDT 2018
- Previous message (by thread): [Python-Dev] Informal educator feedback on PEP 572 (was Re: 2018 Python Language Summit coverage, last part)
- Next message (by thread): [Python-Dev] Informal educator feedback on PEP 572 (was Re: 2018 Python Language Summit coverage, last part)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 30 June 2018 at 09:49, Chris Barker - NOAA Federal via Python-Dev <python-dev at python.org> wrote:
On Jun 28, 2018, at 8:21 PM, Tim Peters <tim.peters at gmail.com> wrote: Seems it’s all been said, and Tim’s latest response made an excellent case for consistency. But:
Regardless of how assignment expressions work in listcomps and genexps, this example (which uses neither) will rebind the containing block's
x
:[x := 1] This reinforces my point that it’s not just about comprehensions, but rather that the local namespace can be altered anywhere an expression is used — which is everywhere. That trivial example is unsurprising, but as soon as your line of code gets a bit longer, it could be far more hidden.
The significant semantic differences between "{x : 1}" and "{x := 1}" are also rather surprising :)
Cheers, Nick.
-- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
- Previous message (by thread): [Python-Dev] Informal educator feedback on PEP 572 (was Re: 2018 Python Language Summit coverage, last part)
- Next message (by thread): [Python-Dev] Informal educator feedback on PEP 572 (was Re: 2018 Python Language Summit coverage, last part)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]