-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.


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',)

this syntax:

>>> tuple(['hello'])


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

    myset = {'a', 'b'}

is absolutely perfect too!

Python-ideas mailing list