-1 on deprecating the syntax.  the tuple(['hello']) syntax is much much slower, a factor of 20x here.  trailing ,s when you only have one item are how python tuple syntax is defined allowing them to use ()s instead of needing other tokens.

gps

On 3/12/08, Leszek Dubiel <Leszek.Dubiel@dubielvitrum.pl> wrote:


I would suggest to deprecate one-element tuple construction with colon at the end, because this looks ugly, is not self-evident for other people reading code, looks like some type of trickery.

It would prefer tutorial (
http://docs.python.org/dev/3.0/tutorial/datastructures.html#tuples-and-sequences) to use instead of

>>> ('hello',)
('hello',)


this syntax:

>>> tuple(['hello'])
('hello',)
.



PS.

Funcitons set(), tuple(), list() and dict() are good!

Syntax
   
    myset = {'a', 'b'}

is absolutely perfect too!





_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
http://mail.python.org/mailman/listinfo/python-ideas