[Python-ideas] FW: Map-then-filter in comprehensions

Chris Angelico rosuav at gmail.com
Tue Mar 8 14:54:37 EST 2016


On Wed, Mar 9, 2016 at 6:51 AM, Ethan Furman <ethan at stoneleaf.us> wrote:
> So?  Enhance the idea to be allowing
>
> (expr) as (name) anywhere:
>
>   if (file.read() as data):
>       # process data
>
> I'm cool with that.  :)

Well, okay then. Spin that off as its own idea: Name bindings in
expressions. It's a coherent idea, but it's likely to see some fairly
stiff opposition :)

(For what it's worth, I am _not_ in opposition to it.)

ChrisA


More information about the Python-ideas mailing list