A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2018-April/153187.html below:

[Python-Dev] Order of positional and keyword arguments

[Python-Dev] Order of positional and keyword arguments [Python-Dev] Order of positional and keyword argumentsAntoine Pitrou solipsis at pitrou.net
Fri Apr 27 05:59:38 EDT 2018
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.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4