On 31 May 2017 at 15:11, Victor Stinner <victor.stinner at gmail.com> wrote: > So I would suggest to modify the PEP 7 to *always* require braces for if. > > I would also suggest to require braces on "for(...) { ... }" and > "while(...) { ... }". But only if the code has to be modified, not > only to update the coding style. > > Changes which are pure coding style changes should be rejected to > avoid conflicts with other pending pull requests and "code churn". As a practical compromise, I'd argue that if you're changing *existing* code, you should retain the current style. For *new* code, always add braces. So, changing if (func == NULL) return NULL; /* further code */ to if (func1 == NULL) return NULL; /* further code */ you would leave out the braces. But changing /* Code using func */ to if (func == NULL) { return NULL; } /* Code using func */ you include the braces, because it's new code. I'm not against making the PEP mandate braces, but I don't think it's necessary to resolve the situation you describe as having triggered the suggestion :-) Paul
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4