On Tue, 15 Mar 2005 16:16:34 GMT, Gregor Horvath <[EMAIL PROTECTED]> wrote:
> Hi,
> 
>  >>>type(['1'])
> <type 'list'>
> 
>  >>>type(('1'))
> <type 'str'>
> 
> I wonder why ('1') is no tuple????

because, syntactically, those parens are for grouping, and do not
unambiguously define a tuple. It's a python gotcha. To define a
one-tuple, put a comma after the '1':

>>>type(('1',))
<type 'tuple'>

> 
> Because I have to treat this "special" case differently in my code.

you shouldn't have to; post your code if you still think you do.

Peace
Bill Mill
bill.mill at gmail.com
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to