[Python-Dev] Order of positional and keyword arguments
Antoine Pitrou
solipsis at pitrou.net
Fri Apr 27 05:59:38 EDT 2018
More information about the Python-Dev mailing list
Fri Apr 27 05:59:38 EDT 2018
- Previous message (by thread): [Python-Dev] Order of positional and keyword arguments
- Next message (by thread): [Python-Dev] Nickname Binding (PEP 572)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, 26 Apr 2018 22:25:09 +0300 Serhiy Storchaka <storchaka at gmail.com> 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 surprising. If you write f(b=2, a=1), you are also passing arguments "not in order", but it still looks ok to me. > 2. Argument values are evaluated not from left to right. This > contradicts the general rule that expressions are evaluated from left to > right (with few known exceptions). Well... If you have code that relies on that rule, I would agree it's brittle code and should be rewritten differently (perhaps by assigning to temporary variables explicitly). Regards Antoine.
- Previous message (by thread): [Python-Dev] Order of positional and keyword arguments
- Next message (by thread): [Python-Dev] Nickname Binding (PEP 572)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list