On Fri, 17 Feb 2017 at 21:21 Joseph Jevnik <joe...@gmail.com> wrote:

> About the "whatever is d[k]" in five minutes comment: If I created an
> explict closure like: `thunk = lambda: d[k]` and then mutated `d` before
> evaluating the closure you would have the same issue. I don't think it is
> that confusing. If you need to know what `d[k]` evaluates to right now then
> the order of evaluation is part of the correctness of your program and you
> need to sequence execution such that `d` is evaluated before creating that
> closure.
>

If you create an explicit closure, sure. With delayed expressions, you
could explicitly delay d[k], too. If you have an existing d and k,
potentially passed to you by somebody else's code, the delayedness of d and
k should not inflict arbitrarily-delayed sequencing on your attempt to find
out what d[k] is now.
_______________________________________________
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