You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How does "Knuth's style" for line breaks translate to code? #186
In Python code, it is permissible to break before or after a binary operator, as long as the convention is consistent locally. For new code Knuth's style is suggested.
However, I don't see how Knuth's style applies to code. Knuth's style distinguishes between formulas within paragraphs and displayed formulas. What is the analogous distinction in a coding context?
In this context, "Knuth's style" refers to the immediately preceding example, i.e. break before binary operators. We should consider Python code always to be equivalent to "displayed formulas".
Reacted by Chih-Hsueh "Josh" Huang and Anubhav Balodhi
Activity
gvanrossum commentedon Jan 19, 2017
In this context, "Knuth's style" refers to the immediately preceding example, i.e. break before binary operators. We should consider Python code always to be equivalent to "displayed formulas".