-
Notifications
You must be signed in to change notification settings - Fork 879
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
Consider emitting a warning for the use of continuation characters (except in strings) #11252
Comments
For completeness, can you give an example of the pattern you want to lint against, and the suggested alternative? |
Sure, from the CPython source: if self.size_read == self.chunksize and \
self.align and \
(self.chunksize & 1):
dummy = self.file.read(1) I prefer: if (self.size_read == self.chunksize and self.align
and (self.chunksize & 1)):
dummy = self.file.read(1) Of course, it's a matter of opinion, but apparently according a core developor:
|
Not a 'decision' but as a heads up I'm generally hesitant to add more rules that are made redundant with the formatter. |
The continuation character used outside of strings are no longer necessary as of Python 3.9 thanks to the new PEG parser. This means that we can always use parentheses. And parentheses have the advantage of not interfering with comments, and for some people are easier to read.
Also, doing a grep on Python source suggests that many Python programmers are preferring parenthesis continuations—except in strings.
Would it make sense to warn on them?
The text was updated successfully, but these errors were encountered: