On May 11, 10:54 pm, [EMAIL PROTECTED] wrote: > To create a tuple with one element, you need to do this: > > >>> my_tuple = (1,) # Note the trailing comma after the value 1 > >>> type(my_tuple) > > <type 'tuple'> >
You needn't at all. You could simply do this: >>> your_tuple = 1, You see, it's not the parentheses that make the tuple. > But if you do this > > >>> my_tuple = (1) > >>> type(my_tuple) > > <type 'int'> > > you don't get a tuple. For which the BDFL should make us eternally grateful. > it would be clean if Python would convert anything put into ( ) to > be a tuple You seriously want 2*(3+4) to return (7,7)? You call that "clean"?! At least type(my_tuple) would always return 'tuple,' whether it was or not. ;) -- http://mail.python.org/mailman/listinfo/python-list