Why can't you use varargs and keyword arguments together?

Sandra-24 sandravandale at yahoo.com
Thu Dec 21 20:03:05 EST 2006


On Dec 21, 5:59 pm, Jean-Paul Calderone <exar... at divmod.com> wrote:
>You just need to turn things around:
>   >>> def foo(a, b, c):
>   ...     return a, b, c
>   ...
>   >>> args = range(2)
>   >>> foo(c=2, *args)
>   (0, 1, 2)
>   >>>

You know, I feel like a real shmuck for not trying that...

Thanks!
-Sandra




More information about the Python-list mailing list