> 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 <[email protected]> wrote:

> On Fri, 17 Feb 2017 at 21:18 Joseph Jevnik <[email protected]> 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.
>
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to