[Python-ideas] FW: Map-then-filter in comprehensions
Émanuel Barry
vgr255 at live.ca
Tue Mar 8 09:59:18 EST 2016
Hello,
I’m mostly in favour of extending the comprehension syntax, but not at any cost. The `as` proposal is a big -1 from me. Right now, `as` is used for :
- from foo import bar as baz
- try: ... except Exception as e: ...
And maybe a few others I’ve probably forgotten. The general concept is name binding, so if I see something like
[x for x, y in some_iterable as y > 5]
I’m going be confused by what sort of name binding it does. A quick glance at the keywords list tells me that no currently-existing keyword is “the obvious choice” for this purpose. I don’t think such a small niche warrants a new keyword, either.
Python is mostly intuitive, and your proposition is anything but intuitive to me.
-1 from me for now, but might change if you come up with an intuitive syntax.
-Emanuel
~If it doesn’t quack like a duck, add a quack() method~
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160308/f5143063/attachment.html>
More information about the Python-ideas
mailing list