Re: Looking for documentation on how Python assigns to function parameters

2017-03-01 Thread Jussi Piitulainen
Steve D'Aprano writes: > Given a function like this: > > > def func(alpha, beta, gamma, delta=4, *args, **kw): > ... > > > which is called in some fashion: > > # say > func(1, 2, gamma=3, epsilon=5) > > which may or may not be valid: > > func(1, 2, alpha=0) > > how does Python match up the for

Re: Looking for documentation on how Python assigns to function parameters

2017-03-01 Thread Steve D'Aprano
On Wed, 1 Mar 2017 10:18 pm, Steve D'Aprano wrote: [...] > how does Python match up the formal parameters in the `def` statement with > the arguments given in the call to `func`? > > I'm looking for official docs, if possible. So far I've had no luck > finding anything. Never mind, I found it ab

Looking for documentation on how Python assigns to function parameters

2017-03-01 Thread Steve D'Aprano
Given a function like this: def func(alpha, beta, gamma, delta=4, *args, **kw): ... which is called in some fashion: # say func(1, 2, gamma=3, epsilon=5) which may or may not be valid: func(1, 2, alpha=0) how does Python match up the formal parameters in the `def` statement with the arg