[Python-ideas] Delayed Execution via Keyword

Ed Kellett edk141 at gmail.com
Fri Feb 17 17:02:57 EST 2017


On Fri, 17 Feb 2017 at 21:58 Joshua Morton <joshua.morton13 at gmail.com>
wrote:

> Ed, I'm not seeing this perceived problem either.
>
> if we have
>
>     >>> d = delayed {'a': 1, 'b': 2}  #  I'm not sure how this is delayed
> exactly, but sure
>     >>> k = delayed string.ascii_lowercase[0]
>     >>> d[k]
>     1
>

My problem with this doesn't have to do with subexpressions.

If d[k] for delayed d and k yields delayed d[k], then someone mutates d,
you get an unexpected result. So I'm suggesting that d[k] for delayed d and
k should evaluate d and k, instead.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170217/725e5032/attachment-0001.html>


More information about the Python-ideas mailing list