unary star

"Martin v. Löwis" martin at v.loewis.de
Sun May 4 11:12:05 EDT 2003


holger krekel wrote:

> I can see good uses for getting the unary-star syntax "*args" 
> in other than function call contexts. E.g.
> 
>     head, *rest = l

Yes, that might be a good use. However, it is quite different
from David's proposed extension.

> Anyway, trying to leverage the unary-star syntax for other than 
> "function call parameter" contexts seems worthwhile to me.  

Only on a case-by-case basis. I can't see the advantage of

    (a,b,c,*d)

over

    (a,b,c)+d

The second alternative is probably better, as it would be more
portable: the first alternative can function in Python 2.4, earliest.

There should be one-- and preferably only one --obvious way to do it.

Regards,
Martin







More information about the Python-list mailing list