[Python-ideas] Re: Add kwdefaults parameter to function constructor

2019-10-18 Thread Andrew Barnert via Python-ideas
On Oct 18, 2019, at 12:17, Gus Wiedey wrote: > > I actually have a commit already made, but I realized there is one possible > complication that I may have overlooked: if there are keys in __kwdefaults__ > that don't correspond to any explicitly-named arguments in the signature, > will those g

[Python-ideas] Re: Add kwdefaults parameter to function constructor

2019-10-18 Thread Gus Wiedey
I actually have a commit already made, but I realized there is one possible complication that I may have overlooked: if there are keys in __kwdefaults__ that don't correspond to any explicitly-named arguments in the signature, will those get ignored or could they cause problems? On Fri, Oct 18, 20

[Python-ideas] Re: Add kwdefaults parameter to function constructor

2019-10-18 Thread Gus Wiedey
First of all, thank you for telling me this. I didn't even know that positional-only parameters existed at all until a few days ago when I discovered them while exploring this issue, let alone that they had been added to Python functions in 3.8. Second, after poking around a bit in 3.8, it looks l

[Python-ideas] Re: Add kwdefaults parameter to function constructor

2019-10-18 Thread Guido van Rossum
The implementation starts here: https://github.com/python/cpython/blob/ecb035cd14c11521276343397151929a94018a22/Objects/funcobject.c#L499 The argument clinic input specifying the signature is a few lines above. Clinic's output is here: https://github.com/python/cpython/blob/master/Objects/clinic/f

[Python-ideas] Re: Add kwdefaults parameter to function constructor

2019-10-18 Thread Anders Hovmöller
Just thinking aloud here but when you say "positional" parameters you mean normal parameters and not positional only parameters as introduced in 3.8 right? And how would those fit into this picture? > On 18 Oct 2019, at 15:31, Gus Wiedey wrote: > >  > I was recently playing around with decora