Re: [Python-Dev] Order of positional and keyword arguments

2018-04-27 Thread Antoine Pitrou
On Thu, 26 Apr 2018 22:25:09 +0300 Serhiy Storchaka wrote: > > f(b=2, *[1]) is surprised in two ways: > > 1. Argument values are passed not in order. The first value is assigned > to the second parameter, and the second value is assigned to the first > parameter. I don't find it that surprisi

Re: [Python-Dev] Order of positional and keyword arguments

2018-04-27 Thread Chris Jerdonek
On Thu, Apr 26, 2018 at 12:25 PM, Serhiy Storchaka wrote: > f(b=2, *[1]) is surprised in two ways: > > 1. Argument values are passed not in order. The first value is assigned to > the second parameter, and the second value is assigned to the first > parameter. > > 2. Argument values are evaluated

Re: [Python-Dev] Order of positional and keyword arguments

2018-04-26 Thread Paul Moore
I see no practical benefit to making such a restriction, and there's a risk of breaking existing code. While it's not something I've ever used myself in real code, def wrapper(*args, **kw): return wrapped_fn(some_arg=1, *args, **kw) seems like a perfectly reasonable way to write a wr