
On Tue, Mar 31, 2015 at 4:30 PM, Andrew Barnert abarnert@yahoo.com wrote:
On Mar 30, 2015, at 23:35, INADA Naoki songofacandy@gmail.com wrote:
What about adding rule about trailing comma?
I don't understand the proposed rule from your example. Are you suggesting that a trailing comma be a syntax error unless it's following by a newline?
I'm sorry, I meant about adding rule to PEP 8. Not Python syntax.
That would explain both "yesses" and the first "no", but then what's wrong with the second "no"? You can always add newlines in the middle of any parenthesized expression; are you suggesting that you shouldn't be allowed to add one at the very end, unless it's immediately following a comma? If so, why?
Also, you seem to realize you're adding a gratuitous inconsistency with one-element tuples. Haven't they been through enough teasing without having to make them even more different?
Most of all, whatever your actual rule is: Why? What's the intended benefit here?
I recently write Go program more than Python. I feel good about line continuation rule in Go: Some characters including comma means line continuation.
Benefit of this style is:
1) More consistent 2) No garbage diff just for just adding comma
Yes:
foo(aaa, bbb)
or
foo(aaa, bbb, )
No:
foo(aaa, bbb,) # except one-value tuple.
or
foo(aaa, bbb )
-- INADA Naoki songofacandy@gmail.com _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/