[1,2,3] exactly same as [1,2,3,] ?

Roy Smith roy at panix.com
Sat Aug 30 11:17:25 EDT 2008


In article <mailman.276.1220108706.3487.python-list at python.org>,
 Fredrik Lundh <fredrik at pythonware.com> wrote:

> Roy Smith wrote:
> 
> > Yowza, you're right (at least for the one case I tried).  This must be a 
> > new development (where "new development" is defined as, "It wasn't legal in 
> > the original K&R C I learned when I was a pup").
> 
> the C 89 grammar appears to be:
> 
>      initializer:
>          assignment-expression
>          { initializer-list }
>          { initializer-list , }
> 
>      initializer-list:
>          designation-opt initializer
>          initializer-list , designation-opt initializer
> 
> so a trailing comma has been allowed for around twenty years.
> 
> </F>

C89 came out about 10 years after I first learned C :-)



More information about the Python-list mailing list