Is the => syntax needed? as far as I can think of, the only time where late
evaluation is needed is when the expression references the other arguments. So
the rule “if the expression reference other arguments it will get evaluated at
function call time” should suffice right?
In effect:
def
On Sat, Dec 24, 2022 at 11:34:19AM -0500, Shironeko wrote:
>
> Is the => syntax needed? as far as I can think of, the only time where
> late evaluation is needed is when the expression references the other
> arguments.
You are missing the most common case, the motivating case, for
late-bound d
On Mon, 26 Dec 2022 at 04:53, Steven D'Aprano wrote:
>
> On Sat, Dec 24, 2022 at 11:34:19AM -0500, Shironeko wrote:
> >
> > Is the => syntax needed? as far as I can think of, the only time where
> > late evaluation is needed is when the expression references the other
> > arguments.
>
> You are mi
I didn't realize def foo(x, y=[]) had this strange artifact but it totally
makes sense, TIL. I did not get the right idea reading the PEP though, since
currently the motivation reads:
> Optional function arguments, if omitted, often have some sort of logical
> default value. When this value dep
On Mon, 26 Dec 2022 at 10:02, wrote:
>
> I didn't realize def foo(x, y=[]) had this strange artifact but it totally
> makes sense, TIL. I did not get the right idea reading the PEP though, since
> currently the motivation reads:
>
> > Optional function arguments, if omitted, often have some sort