Mike314 wrote: (paraphrased)
>>> test_func(val=('val1'))
<type 'str'>
>>> test_func(val=('val1', 'val2'))
<type 'tuple'>
The output is quite different. Why I have string in the first case?

More natural English:  "Why do I get string in the first case?"

(X) is the same as X (parentheses are for grouping), to get
a singleton, you need (X,).  ((((3)))) is just a 3 with a bunch
of meaningless parens around it.  So, you want:
    test_func(val=('val1',))

--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to