Make Python create a tuple with one element in a clean way

Filip Štědronský regnarg at seznam.cz
Sun May 11 09:17:35 EDT 2008


Hello,

> so it would be clean if Python would convert anything put into ( ) to
> be a tuple, even if just one value was put in (without having to use
> that ugly looking comma with no value after it).

if it worked that way, it will absolutely mess up Python syntax, because
we mathematicians are used to use parentheses to force explicit operator
precedence, to group expressions, etc.

Should (1+1)*2 yield 4 or (2,2) ?




More information about the Python-list mailing list