| 30 | |
| 31 | == Style == |
| 32 | |
| 33 | For discussion purposes, here are some style guidelines to consider in addition to [http://www.python.org/dev/peps/pep-0008/ PEP8]: |
| 34 | |
| 35 | * Prefer single quotes to double quotes. Use double quotes only if the string contains single quotes (or if you are using "triple double quotes"). This makes cutting and pasting from the console easier since Python itself behaves this way when rendering string values to the console. |
| 36 | * Order `from` and `import` statements by the name of the leading module instead of putting all `from` statements before `import` statements: |
| 37 | {{{ |
| 38 | # Correct: |
| 39 | import logging |
| 40 | from optparse import OptionParser |
| 41 | import sys |
| 42 | |
| 43 | # Incorrect: |
| 44 | from optparse import OptionParser |
| 45 | import logging |
| 46 | import sys |
| 47 | }}} |
| 48 | This keeps the ordering the same when chaning a `from` statement to an `import` statement, or vice versa. |