[Python-ideas] Delayed Execution via Keyword
edk141 at gmail.com
Fri Feb 17 17:01:24 EST 2017
On Fri, 17 Feb 2017 at 21:57 Joseph Jevnik <joejev at gmail.com> wrote:
> > You should be able to pass the result to *any* existing code that
> expects a function and sometimes calls it, and the function should be
> called when that happens, rather than evaluated to a delayed object and
> then discarded.
> I disagree with this claim because I do not think that you should have
> side effects and delayed execution anywhere near each other.
If Python gets delayed execution, it's going to be near side effects.
That's just the reality we live in.
> You only open youself up to a long list of special cases for when and
> where things get evaluated.
Not really. With the function call example, as long as x() always evaluates
x (rather than becoming a delayed call to x), we're all good. Remember that
this has nothing to do with the contents of x, which indeed shouldn't use
delays if it cares about side effects—what might be delayed here is the
expression that finds x.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas