[Python-ideas] "given" vs ":=" in list comprehensions
ncoghlan at gmail.com
Mon May 14 00:02:21 EDT 2018
On 12 May 2018 at 20:34, Andre Roberge <andre.roberge at gmail.com> wrote:
> Sorry for chiming in so late; I was lurking using google groups and had to
> subscribe to post - hence this new thread.
> I gather that *where* has been discarded as a possible new keywords given
> its use as a function in numpy (https://docs.scipy.org/doc/
> numpy-1.14.0/reference/generated/numpy.where.html) ... Still, I will
> include it below for completeness (and as I think it reads better than the
> other choices)
The same grammar adjustment that I believe will allow "given" to be used as
both a postfix keyword and as a regular name would also work for "where".
However, "where" still has the problem of semantically conflicting with
SQL's use of it to introduce a filter clause, whereas Hypothesis uses
"given" to bind names to values (just a little more indirectly than would
be the case for assignment expressions)
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas