On 3/12/2021 4:42 PM, Paul Bryan wrote:
Using your example (thanks, seeing a concrete example is helpful) it appears you can do it the SQL way in Python too:

x = (1
,2
,3
)

Right. It's just that no one would want to!

Eric



On Fri, 2021-03-12 at 16:35 -0500, Eric V. Smith wrote:
On 3/12/2021 3:37 PM, Greg Ewing wrote:
On 13/03/21 5:02 am, Ned Batchelder wrote:
I think the only reason anyone ever used leading commas to begin with
was because of languages that didn't allow a final trailing comma.
In those worlds, to keep the editing smooth, people moved the commas
to the beginning of the line,

Which doesn't help unless the language allows leading commas that
are ignored, and I've never seen a language like that.

Things are added to the end of lists more often than to the front. For
example, column names in SQL or parameters in Python.

Because SQL doesn't allow trailing commas, I've often seen things
written as:

select a
,b
,c
,d

Then when you want to add "e" to the end, you just duplicate the ",d"
row and change "d" to "e".

For Python, you'd do:

select(a,
b,
c,
d,
)

And then similarly add "e," to the end.

Anyway, since Python already allows trailing commas, I see no need to
add leading ones. Which is a feature I've never seen in any language,
either. And it would make it slightly easier to leave off the first
parameter.

Eric

_______________________________________________
Python-ideas mailing list -- python-ideas@python.org <mailto:python-ideas@python.org> To unsubscribe send an email to python-ideas-le...@python.org <mailto:python-ideas-le...@python.org> https://mail.python.org/mailman3/lists/python-ideas.python.org/ <https://mail.python.org/mailman3/lists/python-ideas.python.org/> Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/R6AU26PL4QK5LFMW25PP2VUVLFSTDGX6/ <https://mail.python.org/archives/list/python-ideas@python.org/message/R6AU26PL4QK5LFMW25PP2VUVLFSTDGX6/> Code of Conduct: http://python.org/psf/codeofconduct/ <http://python.org/psf/codeofconduct/>

--
Eric V. Smith

_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/TJVRA2VUX6UIK4KQGZ47W44OFCW65CM6/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to