<div dir="ltr">Ed, I'm not seeing this perceived problem either.<div><br></div><div>if we have</div><div><br></div><div> >>> d = delayed {'a': 1, 'b': 2} # I'm not sure how this is delayed exactly, but sure</div><div> >>> k = delayed string.ascii_lowercase[0]</div><div> >>> d[k]</div><div> 1</div><div><br></div><div><br></div><div>I'm not sure how the delayedness of any of the subexpressions matter, since evaluating the parent expression will evaluate all the way down.</div><div><br></div><div>--Josh</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Feb 17, 2017 at 4:53 PM Ed Kellett <<a href="mailto:edk141@gmail.com">edk141@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Fri, 17 Feb 2017 at 21:21 Joseph Jevnik <<a href="mailto:joejev@gmail.com" class="gmail_msg" target="_blank">joejev@gmail.com</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">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.</div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg">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.</div></div></div>
_______________________________________________<br class="gmail_msg">
Python-ideas mailing list<br class="gmail_msg">
<a href="mailto:Python-ideas@python.org" class="gmail_msg" target="_blank">Python-ideas@python.org</a><br class="gmail_msg">
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" class="gmail_msg" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br class="gmail_msg">
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" class="gmail_msg" target="_blank">http://python.org/psf/codeofconduct/</a></blockquote></div>