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
When using print inside indented contexts (functions, if statements, loops, etc) it is not possible to correctly format the template string without breaking the surrounding indentation:
It is possible to see that the most common intent with this code would be to print the message without the leading new line and the extra indentation. To achieve this, one would have to rewrite the code as:
When using
print
inside indented contexts (functions, if statements, loops, etc) it is not possible to correctly format the template string without breaking the surrounding indentation:Prints:
It is possible to see that the most common intent with this code would be to print the message without the leading new line and the extra indentation. To achieve this, one would have to rewrite the code as:
I propose changing the
print
function to automatically format template strings by:However, this change may break existing code
but I consider it to be worth it.Edit:
The compiler can't tell the difference between these two examples, so the first would not behave as expected:
The text was updated successfully, but these errors were encountered: