[Python-ideas] Python Users Aren't Perfect

Ned Batchelder ned at nedbatchelder.com
Fri Dec 16 03:55:16 CET 2011

On 12/15/2011 9:23 PM, Ben Finney wrote:
> Ned Batchelder<ned at nedbatchelder.com>
> writes:
>> Then we define a function foo(*args), and Python gives us a tuple! :-(
> Yes, exactly: the positional arguments to the function are *not* a
> homogeneous sequence, so a list doesn't connote the right thing. The
> position is important – we call them “positional arguments” – so a tuple
> makes sense.
In general the positional arguments to a function are not homogenous, 
but the foo(*args) syntax is for precisely when you don't know how many 
args you will get, and you will of necessity treat them homogenously, 
no?  We've been through this in another branch of this thread...


More information about the Python-ideas mailing list