On Sun, Apr 10, 2016, at 05:13 PM, Fillmore wrote: > I guess that the answer to my question is: there is no such thing as a > one-element tuple, > and Python will automatically convert a one-element tuple to a string... > hence the > behavior I observed is explained... > > >>> a = ('hello','bonjour') > >>> b = ('hello') > >>> b > 'hello' > >>> a > ('hello', 'bonjour') > >>> > > > Did I get this right this time?
No, you didn't. Your mistake is again -- parens don't make tuples, commas do. A one element tuple is: >>> b = ("hello,) The parens are optional, I always put them in because: >>> b = "hello", The parens group an expression, they don't make a type. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list