On Oct 11, 2016 10:40 AM, "Erik Bray" <erik.m.b...@gmail.com> wrote: > > On Sun, Oct 9, 2016 at 2:25 AM, Steven D'Aprano <st...@pearwood.info> wrote: > > On Sat, Oct 08, 2016 at 09:26:13PM +0200, Jelte Fennema wrote: > >> I have an idea to improve indenting guidelines for dictionaries for better > >> readability: If a value in a dictionary literal is placed on a new line, it > >> should have (or at least be allowed to have) a n additional hanging indent. > >> > >> Below is an example: > >> > >> mydict = {'mykey': > >> 'a very very very very very long value', > >> 'secondkey': 'a short value', > >> 'thirdkey': 'a very very very ' > >> 'long value that continues on the next line', > >> } > > > > Looks good to me, except that my personal preference for the implicit > > string concatenation (thirdkey) is to move the space to the > > following line, and (if possible) align the parts: > > mydict = {'mykey': > > 'a very very very very very long value', > > 'secondkey': 'a short value', > > 'thirdkey': 'a very very very' > > ' long value that continues on the next line', > > } > > Heh--not to bikeshed, but my personal preference is to leave the > trailing space on the first line. This is because by the time I've > started a new line (and possibly have spent time fussing with > indentation for the odd cases that my editor doesn't get quite right) > I'll have forgotten that I need to start the line with a space :)
Until you end up with like 20 merge conflicts because some editors strip trailing whitespace... > > Best, > Erik > _______________________________________________ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ -- Ryan [ERROR]: Your autotools build scripts are 200 lines longer than your program. Something’s wrong. http://kirbyfan64.github.io/
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/