[Python-ideas] values in vs. values out

Masklinn masklinn at masklinn.net
Thu Jan 13 20:27:39 CET 2011


On 2011-01-13, at 20:12 , Alexander Belopolsky wrote:
> 
>> 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.

Indeed, barring partial dictionary matching (take PEP 3132 and now do the same with dicts) *and* a new object which combines attributes of tuples and dictionaries (and lets the user match them both at once, some kind of ordered dictionary with offsets so the initial values can be purely positional) I don't see how it would be possible to replicate Python's breadth of arguments unpacking in return values.

Considering Python's tendency to hedge towards functional programming and pattern matching (these days it runs the opposite way as fast as possible and doesn't stop until it's gone through a few borders), I don't see it happening any time soon, even ignoring the debatable value of the scheme.




More information about the Python-ideas mailing list