Why tuple with one item is no tuple

Gregor Horvath g.horvath at mx.at
Tue Mar 15 11:16:34 EST 2005


Hi,

 >>>type(['1'])
<type 'list'>

 >>>type(('1'))
<type 'str'>

I wonder why ('1') is no tuple????

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

--
Greg



More information about the Python-list mailing list