<p dir="ltr">Makes sense, maybe you can send a PR to the Python/peps repo?</p>
<p dir="ltr">--Guido (mobile)</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Oct 8, 2016 12:27 PM, "Jelte Fennema" <<a href="mailto:me@jeltef.nl">me@jeltef.nl</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">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.<div><br></div><div>Below is an example:</div><div><br></div><div><font face="monospace, monospace">mydict = {'mykey':</font></div><div><font face="monospace, monospace"> 'a very very very very very long value',</font></div><div><font face="monospace, monospace"> 'secondkey': 'a short value',</font></div><div><font face="monospace, monospace"> 'thirdkey': 'a very very very '</font></div><div><font face="monospace, monospace"> 'long value that continues on the next line',</font></div><div><font face="monospace, monospace">}</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">As opposed to this IMHO much less readable version:</font></div><div><font face="monospace, monospace"><br class="m_-4609910455894954360gmail-Apple-interchange-newline"></font><div><font face="monospace, monospace">mydict = {'mykey':</font></div><div><font face="monospace, monospace"> 'a very very very very very long value',</font></div><div><font face="monospace, monospace"> 'secondkey': 'a short value',</font></div><div><font face="monospace, monospace"> 'thirdkey': 'a very very very '</font></div><div><font face="monospace, monospace"> 'long value that continues on the next line',</font></div><div><font face="monospace, monospace">}</font></div></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">As you can see it is much harder in the second version to distinguish between keys and values.</font></div><div><font face="monospace, monospace"><br></font></div></div>
<br>______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br></blockquote></div></div>