On 09/11/2013 20:33, Mark Janssen wrote:
* Call me pedantic by why do we need a trailing comma for a list of one
item? Keep it intuitive and allow lstShopping=[] or ["Bread"] or
["Bread", "Milk","Hot Chocolate"] I don't like ["Bread",]. It bugs me.
This one got answered, it has to do with the parser when dealing with parens.
It got answered and was simply mistaken, no comma is needed but a comma
will be accepted. How did the parser enter into this, or are you also
thinking about tuples?
>>> mylist=['Bread']
>>> mylist
['Bread']
>>> mylist=['Butter',]
>>> mylist
['Butter']
--
Python is the second best programming language in the world.
But the best has yet to be invented. Christian Tismer
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list