On 2018-03-03 08:09 AM, Oleg Broytman wrote:
On Sat, Mar 03, 2018 at 02:36:39PM +1300, Greg Ewing 
<greg.ew...@canterbury.ac.nz> wrote:
    [(f(y), g(y)) for x in things where y = h(x)]

Possible objections to this:

* Requires a new keyword, which may break existing code.

- Yes, but "where" is an unlikely choice of name, being
neither a noun, verb or adjective, so it probably wouldn't
break very *much* code.
``where`` is a very popular name in code related to SQL. Take for
example ORMs:

https://github.com/sqlobject/sqlobject/search?l=Python&q=where&type=&utf8=%E2%9C%93

https://github.com/zzzeek/sqlalchemy/search?l=Python&q=where&type=&utf8=%E2%9C%93

[(lambda y: (f(y), g(y)))(h(x)) for x in things] ?


--
Greg
Oleg.

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to