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. |
| 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 simplifies writing unit tests because Python behaves this way when rendering string objects to the console. For example-- |
| 39 | {{{ |
| 40 | >>> list = ["blah", 'blah', '\'blah\''] |
| 41 | >>> print list |
| 42 | ['blah', 'blah', "'blah'"] |
| 43 | }}} |
| 44 | This allows console output to be cut and pasted directly into the code when writing and updating unit tests. |