[EMAIL PROTECTED] wrote:

> Or, just always send the function a list. If you have one string, send
> it a list containing that one string.

Or, if a single string is more common and the lists are short or generated
only for the function call, have the function accept a variable number of
arguments:

>> def my_function(*items):
...     print " ".join(items)
...
>>> my_function("alpha")
alpha
>>> my_function("alpha", "beta")
alpha beta
>>> items = ["alpha", "beta", "gamma"]
>>> my_function(*items)
alpha beta gamma

Peter
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to