Thank you Roland, for that idea!
On Tue, Mar 16, 2021 at 01:52:48PM +0100, Roland Puntaier via Python-ideas
wrote:
On Mon 21Mar15 22:24, Stephen J. Turnbull wrote:
Roland Puntaier via Python-ideas writes:
Aesthetic Concern: No
=====================
It might seem an aesthetic concern,
but I thought a bit about it,
and I don't think it is.
I has been also conservative about leading commas.
But with huge using and generating of sql files I came to „taste“ of it.
In SQL it is very common and aesthetic and practical to write the comma
on the beginning of a line:
SELECT …
FROM (
SELECT column1
, column2
, column3
FROM t1
JOIN t2 ON …
) AS q1
…
You can easily add or remove columns.
In addition you see the relation corresponding SELECT and FROM keywords in
(indented) subqueries.
The possibility of leading comma before the first column is also very missing.
As you hinted, possibly add an option line above/before.
One would use it only for lines, of course. One would not write `[,1,2]`,
but one possibly would write
def long_fun(
, long_option = 'long_expression_for_default'.split('_'),
, option1=1
)
:pass
Nice. Also useful for huge dict/mappings definitions.
Can the proposal be generalized to other operators?
===================================================
Yes.
I find the case for allowing logical line continuation by a leading
operator stronger than allowing a leading comma in a sequence display.
But I don't particularly *want* it, so I'll leave it to you to make
that argument if you want to.
Allowing operators to start an expression already has a meaning in
some cases, but I don't see a good argument for establishing a general
rule that a missing operand is the identity, even though that works
for leading "+" and "-". It's already not the case for "*" and "**",
and "~" has no binary counterpart.
This is not my proposal, but I would welcome it.
I also.
H.
_______________________________________________
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/24KMKOC6UQIOODXWGCJGEJLIRZPW745U/
Code of Conduct: http://python.org/psf/codeofconduct/