Re: maybe a bug in python

2005-06-06 Thread Steven Bethard
venkata subramanian wrote: > If you have any doubts, > try to remeber this when creating tuples, > > if a tuple is to have 0 elements, > then it must be given as a=() > in other words, the ( and the ) are essential > > if it has one element, > then a comma after that element is essential > a=1,

Re: maybe a bug in python

2005-06-06 Thread venkata subramanian
If you have any doubts, try to remeber this when creating tuples, if a tuple is to have 0 elements, then it must be given as a=() in other words, the ( and the ) are essential if it has one element, then a comma after that element is essential a=1, or alternatively a=(1,) in other words, an end

Re: maybe a bug in python: NOW Pythonic Gotchas

2005-06-05 Thread Ivan Van Laningham
Hi All-- This little gotcha ought to be number one on "The Official List of Pythonic Gotchas," which should be required reading for everyone. What? There isn't one? Why not? Send me your tired, your poor, your huddled gotchas yearning to breathe free. I'll whup 'em into shape and make a doc pa

Re: maybe a bug in python

2005-06-05 Thread =?ISO-8859-1?Q?Tiago_St=FCrmer_Daitx?=
Just as everyone said, use ('a',) instead of ('a'). As Steve said there are lots of documentation about it. Check the Library Reference at http://www.python.org/doc/current/lib/typesseq.html#l2h-155 or to make things more clear you could read the tuples section in the tutorial at http://docs.python

Re: maybe a bug in python

2005-06-05 Thread Steve Horsley
flyaflya wrote: > > >>> a = {1: ("a")} > >>> a[1] > 'a' > why not ('a')? when > >>> a = {1: ((("a")))} > >>> a[1] > 'a' > the result is 'a' too,not ((("a"))).but when use["a"] or ("a","b"),the > tuple is longer than 1, it's no problem. > > > To define a tuple literal with one member, you

Re: maybe a bug in python

2005-06-05 Thread Torsten Bronger
Hallöchen! flyaflya <[EMAIL PROTECTED]> writes: a = {1: ("a")} a[1] > 'a' > why not ('a')? ("a") is not a tuple, but ("a",) is. Tschö, Torsten. -- Torsten Bronger, aquisgrana, europa vetus -- http://mail.python.org/mailman/listinfo/python-list

Re: maybe a bug in python

2005-06-05 Thread Will McGugan
flyaflya wrote: > > >>> a = {1: ("a")} > >>> a[1] > 'a' > why not ('a')? when > >>> a = {1: ((("a")))} > >>> a[1] > 'a' > the result is 'a' too,not ((("a"))).but when use["a"] or ("a","b"),the > tuple is longer than 1, it's no problem. > > ("a") is just a simple expression. You need to add