Changes between Version 15 and Version 16 of PythonGuidelines
- Timestamp:
- Apr 14, 2010, 12:44:13 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PythonGuidelines
v15 v16 37 37 38 38 * 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. 39 * Order `from` and `import` statements by the name of the leading module instead of putting all `from` statements before `import` statements:39 * Order `from` and `import` statements within a group by the name of the leading module instead of putting all `from` statements before `import` statements: 40 40 {{{ 41 41 # Correct: … … 49 49 import sys 50 50 }}} 51 This keeps the ordering of lines the same when changing a `from` statement to an `import` statement, and vice versa. This also makes it easer to see if both `from` and `import` statements are used to import from the same package (since the lines will be adjacent). 51 This keeps the ordering of lines the same when changing a `from` statement to an `import` statement, and vice versa. This also makes it easer to see if both `from` and `import` statements are used to import from the same package (since the lines will be adjacent). By "within a group," we mean in the PEP8 sense of grouping standard library imports separately from local application imports, etc. 52 52 53 53 == Upgrading from Python 2.3 or Python 2.4 ==