Many programming languages allow “trailing commas”:
my_list = [ 1, 2, 3, ]
This is wonderful because you can treat the last element like the previous ones instead of having to make an exception. I use it all the time, even when it provides no benefit, and I think we should even start allowing it in natural language.
Many programming languages allow “trailing commas”:
my_list = [ 1, 2, 3, ]This is wonderful because you can treat the last element like the previous ones instead of having to make an exception. I use it all the time, even when it provides no benefit, and I think we should even start allowing it in natural language.
This is also necessary for lists in python with one member. Or was.
I think you mean tuples, because
(1) == 1, but(1, ) == tuple([1]).