comparison doc/v2_planning/coding_style.txt @ 1293:879a5633bb52

A small addendum about the 'import A as B' moratorium.
author David Warde-Farley <wardefar@iro.umontreal.ca>
date Fri, 01 Oct 2010 11:27:41 -0400
parents 58a6919d3649
children e78ced0d6540
comparison
equal deleted inserted replaced
1263:10113a1050ce 1293:879a5633bb52
112 module dependencies." 112 module dependencies."
113 OD: Decision was taken in committee's meeting to allow 113 OD: Decision was taken in committee's meeting to allow
114 from foo import Bar, Blah 114 from foo import Bar, Blah
115 when imported stuff is re-used multiple times in the same file, and 115 when imported stuff is re-used multiple times in the same file, and
116 there is no ambiguity. 116 there is no ambiguity.
117 DWF: One exception I'd like to propose to the "import A as B" moratorium
118 is that we adopt the "import numpy as np" standard that's used in
119 NumPy and SciPy itself. For NumPy heavy code this really cuts down
120 on clutter, without significant impact on readability (IMHO).
117 121
118 * Imports should usually be on separate lines. 122 * Imports should usually be on separate lines.
119 OD: I would add an exception, saying it is ok to group multiple imports 123 OD: I would add an exception, saying it is ok to group multiple imports
120 from the standard library on a single line, e.g. 124 from the standard library on a single line, e.g.
121 import os, sys, time 125 import os, sys, time