Verbose and flexible args and kwargs syntax

Arnaud Delobelle arnodel at gmail.com
Tue Dec 13 05:15:33 EST 2011


On 13 December 2011 09:50, Eelco <hoogendoorn.eelco at gmail.com> wrote:
>> To answer that question: for the same reasons. The conversion is
>> wasteful; allowing python to do the right thing based on a
>> typeconstraint is not. Plus, it is less code, and more readable code;
>> the only rule you have to learn is quite general, which is that :: is
>> a type constraint annotation; no need to remember specifics, like
>> 'unpacking always returns lists for some arbitrary reason'.
>
> Oh my bad; actually, that should be:
>
> 'collecting the remainder of an unpacked iterable using * will always
> yield a list. That is, unless the construct appears inside a function
> definition; then somehow a tuple is always the right choice'

When you quote somebody (even yourself), it would be helpful if you
attributed your quote.

-- 
Arnaud



More information about the Python-list mailing list