Le mer. 14 mars 2018 à 18:04, Carl Meyer <c...@oddbird.net> a écrit :
> On 3/14/18 8:03 AM, Guido van Rossum wrote: > > I use the feature regularly for long error messages, and when combined > > with .format() or % it's not so easy to replace it with a + (it would > > require adding parentheses). > > > > So I am against formally discouraging it or adding something to PEP 8. > > > > However linters could warn about lists of comma-separated strings with a > > missing comma. > > +1 to all of this. > > It's possible to write a linter rule that will reliably catch the > potential missing-comma errors, while still allowing implicit string > concatenation where it's useful and readable. The rule is that implicit > string concatenation should only be disallowed if there are any commas > present at the same "parenthesization level". Thus, this is allowed: > > raise SomeException( > "This is a really long exception message " > "which I've split over two lines." > ) > > While both of these are disallowed: > > fruits = [ > 'orange', > 'grape' > 'banana', > ] > > some_str.replace( > "This is a long string " > "split over two lines.", > "And this is another string." > ) > > +1... if this is indeed implemented in a linter !
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/