how to mutate a tuple?

Emile van Sebille emile at fenx.com
Tue Oct 14 09:39:05 EDT 2003


Carlo v. Dango asks:
> But how do I do this if I only at runtime know the size of the tuple? I
> wish I could pass around lists instead.. that would be so much easier, but
> I'm passing "*args" and "**kwargs" around so I'm not really the one
> deciding the use of tuples or lists ;)

Convert *args to a list:
args = list(args)

kwargs should be a dict anyway, not a tuple.

Emile van Sebille
emile at fenx.com






More information about the Python-list mailing list