* for generic unpacking and not just for arguments?

inhahe inhahe at gmail.com
Sun Nov 29 11:09:04 EST 2009


On Sun, Nov 29, 2009 at 10:40 AM, Mel <mwilson at the-wire.com> wrote:
> Russell Warren wrote:
>
>> Maybe it's just that * is strictly for arguments, and trying it for
>> generic tuple unpacking is abuse (which is down the corridor in 12A).
>
> I'd agree with that.  It's a feature of function calls, not a feature of
> sequence types, so that you can handle a set of function arguments as a
> bunch, and apply them when you want.
>
> The other function call feature that sequence types don't do is
>
> a, b, c = **{'b':3, 'c':a, 'a':c}
>
>
>        Mel.
>
>

that's wicked
i'd go for that
i'd definitely go for the a, b, *c = lst   syntax though



More information about the Python-list mailing list