Should we deprecate comma?

Russel Winder russel at winder.org.uk
Mon Mar 24 06:10:58 PDT 2014


On Mon, 2014-03-24 at 12:44 +0000, bearophile wrote:
[…]
> I agree, 1-tuples in Python are tricky. Compare it with the clear 
> Python list literal syntax:
> 
> []        => 0-length list
> [1]       => 1-length list
> [1, 2]    => 2-length list
> [1, 2, 3] => 2-length list

But note that:

[1,]       => 1-length list
[1, 2,]    => 2-length list
[1, 2, 3,] => 2-length list

Do not underestimate the power of allowed trailing commas.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder



More information about the Digitalmars-d mailing list