[Python-ideas] An alternative to PEP 572's Statement-Local Name Bindings

Oleg Broytman phd at phdru.name
Sat Mar 3 06:09:22 EST 2018


On Sat, Mar 03, 2018 at 02:36:39PM +1300, Greg Ewing <greg.ewing at 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

> -- 
> Greg

Oleg.
-- 
     Oleg Broytman            http://phdru.name/            phd at phdru.name
           Programmers don't die, they just GOSUB without RETURN.


More information about the Python-ideas mailing list