[Python-ideas] Re: PEP 671: Syntax for late-bound function argument defaults

2021-11-04 Thread Stephen J. Turnbull
Rob Cliffe via Python-ideas writes: > Some people clearly need it, viz. those who use a default such as > `[]` and then ask on Stack Overflow why they get surprising > results. That's not a "need". That's a "misunderstanding". > You say you don't need late binding, but I would be very surpr

[Python-ideas] Re: PEP 671: Syntax for late-bound function argument defaults

2021-11-04 Thread Stephen J. Turnbull
Chris Angelico writes: > What I mean is that pedantically correct language inevitably ends up > way too verbose to be useful in an educational context. Nonsense. If you leave out the part in brackets and the "FUD", it's *much* shorter than what Steve wrote, and more accurate. What would requi

[Python-ideas] Re: PEP 671: Syntax for late-bound function argument defaults

2021-11-04 Thread Rob Cliffe via Python-ideas
Taking a step back: Suppose Python didn't have default values AT ALL for function parameters?  Say that unpassed parameters were always set to some sentinel value (maybe None, maybe some special value NotPassed). Would we want to add them to the language? Surely almost everybody would say yes.

[Python-ideas] Re: PEP 671: Syntax for late-bound function argument defaults

2021-11-04 Thread Chris Angelico
On Fri, Nov 5, 2021 at 7:36 AM Rob Cliffe via Python-ideas wrote: > But consider this: AFAICS, *everything* you can do with early binding, you > can do with late binding, but *not* vice versa. (To simulate early binding > if you actually only have late binding, simply put the default value in a