[Python-ideas] values in vs. values out

K. Richard Pixley rich at noir.com
Thu Jan 13 19:16:58 CET 2011


Sounds like you'd be happier returning named tuples.  I'm sure I saw 
something about a named tuple package change recently but I can't find 
it now.  Perhaps someone else will have it.

--rich

On 1/13/11 06:30 , Luc Goossens wrote:
> Hi all,
>
> There's a striking asymmetry between the wonderful flexibility in 
> passing values into functions (positional args, keyword args, default 
> values, *args, **kwargs, ...) and the limited options for processing 
> the return values (assignment).
> Hence, whenever I upgrade a function with a new keyword arg and a 
> default value, I do not have to change any of the existing calls, 
> whereas whenever I add a new element to its output tuple, I find 
> myself chasing all existing code to upgrade the corresponding 
> assignments with an additional (unused) variable.
> So I was wondering whether this was ever discussed before (and 
> recorded) inside the Python community.
> (naively what seems to be missing is the ability to use the assignment 
> machinery that binds functions' formal params to the given actual 
> param list also in the context of a return value assignment)
>
> cheers,
> Luc
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas



More information about the Python-ideas mailing list