[WIP] Improved coding standards#49
Conversation
alquerci
commented
Sep 4, 2014
| Q | A |
|---|---|
| Bug fix? | no |
| New feature? | no |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Related tickets | |
| License | GNU GPLv3 |
- Talk about these conventions
- Clean up the commit history
|
I was adding some inline notes but then I realized it'll be easier for everybody if I make a branch with some language fixes. |
|
Indeed thank you. |
|
I have no problem with any of these. Here's my branch with a few English fixes: https://github.com/nylen/cyg-apt/tree/pr-49-proofreading I noticed you put a space before the colon in |
Indeed |
|
For control structures there MUST be one space between the expression and the colon. The
Without parentheses looks better? When the conditional part of an if-statement is long enough to require that it be written across multiple lines. In this case it need parentheses.
|
|
Let's go with 1a because 1b does not look Pythonic to me. I don't have a strong opinion on 2, but I'd probably prefer the second PEP8 style. I usually leave a blank line between the conditional and the statement, like this: if this_is_one_thing
and that_is_another_thing:
do_something()A comment instead of a blank line is better. If you have a complicated conditional, then you probably need a comment to explain it. |
On Python a file is a module and a module is the unit of reuse.
|
635047d to
4be517a
Compare