[Python-ideas] Re: Conditional 1-line expression in python

2023-07-21 Thread Dom Grigonis
This is very much implementation dependent. And I do not have a big opinion here as I certainly haven’t spent enough time to have one. I am just considering functionality from user’s perspective for the time being. > Let's tackle just this one part for a moment. What does "ensure_eval" > do? Eva

[Python-ideas] Re: Conditional 1-line expression in python

2023-07-21 Thread Dom Grigonis
Having said that, What about a mid-ground approach? Simply have a `deferred` type, which only gets evaluated if it is explicitly asked for. It builds a graph in the same way as dask, but it does not act as a proxy, but rather evaluates if explicitly asked. From technical perspective, it would

[Python-ideas] Re: Conditional 1-line expression in python

2023-07-21 Thread Chris Angelico
On Fri, 21 Jul 2023 at 19:15, Dom Grigonis wrote: > However, it could be done differently as well. If `Break()` takes effect in > the scope where it is evaluated. Then: > You say that as if it's easy. How would this work? How do you have a function that, when called, causes the current loop to b

[Python-ideas] Re: Conditional 1-line expression in python

2023-07-21 Thread Dom Grigonis
Did not mean that it is easy, but it seems achievable and although a deep dig might be needed, my gut feeling is that it is possible to achieve this fairly elegantly. I might be wrong ofc. However, this seems orthogonal to everything else I wrote. Just added it for the sake of completeness, thi

[Python-ideas] Re: Conditional 1-line expression in python

2023-07-21 Thread Chris Angelico
On Fri, 21 Jul 2023 at 19:58, Dom Grigonis wrote: > > Did not mean that it is easy, but it seems achievable and although a deep dig > might be needed, my gut feeling is that it is possible to achieve this fairly > elegantly. I might be wrong ofc. > Start on that deep dig, then, and figure out w