[Python-ideas] Delayed Execution via Keyword

Joseph Jevnik joejev at gmail.com
Fri Feb 17 16:56:47 EST 2017


> 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. You only open
youself up to a long list of special cases for when and where things get
evaluated.

On Fri, Feb 17, 2017 at 4:49 PM, Ed Kellett <edk141 at gmail.com> wrote:

> On Fri, 17 Feb 2017 at 21:18 Joseph Jevnik <joejev at gmail.com> wrote:
>
>> There is no existing code that uses delayed execution so we don't need to
>> worry about breaking it.
>>
>
> I think you're missing the point here. This thing is transparent—that's
> sort of the entire point—so you can pass delayed expressions to other
> things, and it would be better if they didn't have insane behaviour.
>
>
>> I think it would be much easier to reason about if forcing an expression
>> was always explicit. I am not sure what you mean with the second case; why
>> are you delaying a function if you care about the observable side-effect?
>>
>
> You don't delay the function, you delay an expression that evaluates to
> it. 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170217/bd6c37d9/attachment.html>


More information about the Python-ideas mailing list