[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:
Or, just always send the function a list. If you have one string, send
it a list containing that one string.
Cheers,
-T
--
http://mail.python.org/mailman/listinfo/python-list
At Monday 4/12/2006 21:20, manstey wrote:
Is there a neat way to write a function that can receive either a
string or a list of strings, and then if it receives a string it
manipulates that, otherwise it manipulates each string in the list?
That is, rather than having to send a list of one memb
manstey wrote:
> Is there a neat way to write a function that can receive either a
> string or a list of strings, and then if it receives a string it
> manipulates that, otherwise it manipulates each string in the list?
The following code shows one way you can accomplish this. I don't
consider it
Hi,
Is there a neat way to write a function that can receive either a
string or a list of strings, and then if it receives a string it
manipulates that, otherwise it manipulates each string in the list?
That is, rather than having to send a list of one member
MyFunction(['var1']), I can send
MyF