[Python-ideas] values in vs. values out

Alexander Belopolsky alexander.belopolsky at gmail.com
Thu Jan 13 20:12:04 CET 2011

On Thu, Jan 13, 2011 at 10:21 AM, Luc Goossens <luc.goossens at cern.ch> wrote:
> Sorry maybe this was not clear from my mail but I am not so much interested
> in possible work-arounds but in why this asymmetry exists in the first
> place.

It looks like you are asking why tuple unpacking syntax does not
support all options available to argument passing.  Part of it (the
variable length unpacking) is the subject of PEP 3132
<http://www.python.org/dev/peps/pep-3132/>, which was approved, but
the implementation was postponed due to the moratorium on language
changes in effect for 3.2 release.   Note that PEP 3132 does not
really achieve symmetry with argument passing because it makes (a, *x,
b) = .. valid while f(a, *x, b) is not.

> I mean is there a reason as to why it is the way it is, or is it just that
> nobody ever asked for anything else.

No one has ever proposed a design in which tuple unpacking and
argument passing is "symmetric".  This may very well be impossible.

More information about the Python-ideas mailing list