-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Style: removing unnecessary usages of \
from the codebase
#11954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
\
from the codebsae\
from the codebase
xref #11951 (comment) |
Part of the underlying issue here is some editors nowadays (e.g., pycharm) have automatic behavior when it comes to continuation and uses '' continuation by default. |
Can that be disabled? |
There's an automatic wrap option that will wrap lines automatically with '' but if the statement was started with '(' then it will wrap without ''. If one does not wrap automatically then the syntax is up to the user. If a portion of the statement is moved to the next line then '' is used if not already wrapped in '()'. There is no way to add '()' to these statements by default but this should probably be an editor option. PyDev has no such behavior and relies on the user putting in the appropriate continuation and I'm unsure of other editors. |
So, I think if people get in the habit of using '()' at the outset the editor continuation won't be an issue. |
@jorisvandenbossche does |
For cases in python code, yes. So I think we can close this. |
I've found that using parentheses (which allow for automatic continuation) instead of
\
results in a lot more readable code. The lone exception is using\
with long strings and avoiding a line break at the start of the string.Worse:
Better:
OK:
The text was updated successfully, but these errors were encountered: