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

Nathan Goldbaum nathan12343 at gmail.com
Sat Mar 3 11:12:06 EST 2018


On Sat, Mar 3, 2018 at 5:12 AM Oleg Broytman <phd at phdru.name> wrote:

> 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
>

Where is also very common in numpy. So if someone did:

from numpy import *

data = where(condition)

They might have issues


> > --
> > Greg
>
> Oleg.
> --
>      Oleg Broytman            http://phdru.name/            phd at phdru.name
>            Programmers don't die, they just GOSUB without RETURN.
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180303/7f0cd367/attachment.html>


More information about the Python-ideas mailing list