<story><title>Black: An uncompromising Python code formatter</title><url>https://github.com/ambv/black</url></story><parent_chain><item><author>ambivalence</author><text>Colons in slices are implemented to the letter of PEP 8.  Your disagreement here probably stems from pycodestyle mistakenly enforcing a different rule (no spaces before colons on if-statements, defs, and so on) in the slice context.&lt;p&gt;The language itself doesn&amp;#x27;t have an established standard in terms of string quote usage.  If it did, Black would follow it.  What repr() does is a weak indicator and how the documentation is written is random, there was not only no enforcement as to which quotes to use, there wasn&amp;#x27;t even a recommendation.  Black standardizes on double quotes since it has clear benefits whereas the other option does not.</text></item><item><author>zestyping</author><text>This is great except for the enforcement of double-quotes around all strings and spaces around slice operators.  These two choices contradict the standard Python documentation, most of the standard library, and the behaviour of the interpreter itself.&lt;p&gt;When the language itself has an established convention, Black should follow that convention, not fight it.  These two weird choices just generate needless churn, which is surprising as it seems Black has quite the opposite goal.&lt;p&gt;It&amp;#x27;s a shame, because all the other design choices in Black are pretty good!</text></item></parent_chain><comment><author>zestyping</author><text>I thought of another way to express this that might resonate better.&lt;p&gt;What I like about the Black philosophy is that it wants to make code style _uninteresting_.  People should think about other things, not formatting.  That&amp;#x27;s a great goal.  So it seems to me that the best style choice is the most _boring_ choice.  The least creative, least novel way.  It should try to avoid inventing new formatting algorithms.&lt;p&gt;What&amp;#x27;s the most boring way to format a string literal?&lt;p&gt;The way the language already does it.  The way every Python programmer has already seen string literals formatted from the very first day they started typing things into a Python interpreter.&lt;p&gt;Even if half of us liked single-quotes and half of us liked double-quotes, you can guarantee that every Python programmer on the planet has seen and lived with strings that are formatted the repr() way, including the double-quote fans.  You can&amp;#x27;t guarantee the opposite.&lt;p&gt;No one could fault you for doing it the repr() way.  Blame Guido :) he made that choice decades ago, and everyone has already had to make their peace with it.  It&amp;#x27;s a solved problem.  For anyone writing a program that emits Python code, it&amp;#x27;s the default way to format a string.  It&amp;#x27;s the least assailable option, and that&amp;#x27;s a good thing.&lt;p&gt;How does that sit with you?</text></comment>
<story><title>Black: An uncompromising Python code formatter</title><url>https://github.com/ambv/black</url></story><parent_chain><item><author>ambivalence</author><text>Colons in slices are implemented to the letter of PEP 8.  Your disagreement here probably stems from pycodestyle mistakenly enforcing a different rule (no spaces before colons on if-statements, defs, and so on) in the slice context.&lt;p&gt;The language itself doesn&amp;#x27;t have an established standard in terms of string quote usage.  If it did, Black would follow it.  What repr() does is a weak indicator and how the documentation is written is random, there was not only no enforcement as to which quotes to use, there wasn&amp;#x27;t even a recommendation.  Black standardizes on double quotes since it has clear benefits whereas the other option does not.</text></item><item><author>zestyping</author><text>This is great except for the enforcement of double-quotes around all strings and spaces around slice operators.  These two choices contradict the standard Python documentation, most of the standard library, and the behaviour of the interpreter itself.&lt;p&gt;When the language itself has an established convention, Black should follow that convention, not fight it.  These two weird choices just generate needless churn, which is surprising as it seems Black has quite the opposite goal.&lt;p&gt;It&amp;#x27;s a shame, because all the other design choices in Black are pretty good!</text></item></parent_chain><comment><author>mixmastamyk</author><text>Double quotes also have drawbacks, visual noise and the doubling of keypresses required on the most common keyboard layouts.</text></comment>