37 |
RESOLVED: a conversion tool at "make committable" will |
RESOLVED: a conversion tool at "make committable" will |
38 |
convert tabs into 8 spaces |
convert tabs into 8 spaces |
39 |
|
|
40 |
- import grouping is not resolved? |
- how should the import statements be grouped? |
41 |
|
|
42 |
- Rule 1 needs rationale |
- Benja: "I'd prefer first gzz, then java, for consistency with Java files and |
43 |
|
because this makes those imports rest in alphabetical order. (Hmm, come |
44 |
|
to think of it, I would like to have that rule included: In each group, |
45 |
|
imports should be in alphabetical order.)" |
46 |
|
|
47 |
|
- Tuomas: "I disagree: more importantly it should be "foreign stuff" "our stuff"." |
48 |
|
|
49 |
|
I feel that the order of grouping is less important than the actual |
50 |
|
grouping. How about defining the imports as a set of sets? |
51 |
|
|
52 |
|
- does every file need to have its module name in the headers? |
53 |
|
|
54 |
|
[ponder about lava/ and basalt/, otherwise "RESOLVED: No."] |
55 |
|
|
56 |
|
- What case rules should be observed for variables and functions and |
57 |
|
modules? |
58 |
|
|
59 |
|
RESOLVED: modules should be lowercase and variables and functions |
60 |
|
mixedCase. This is the convention that is used in Java and we want |
61 |
|
to keep our Java and python code as closely readable as possibly. |
62 |
|
|
63 |
|
- should "from bar import *" be allowed when importing from current package? |
64 |
|
|
65 |
|
It depends. This is a potential namespace clutterer, and makes code less |
66 |
|
clear, especially for first-time readers, eg.:: |
67 |
|
|
68 |
|
[./foo.py:] |
69 |
|
def a(): print "foo.a" |
70 |
|
|
71 |
|
[./blaa.py:] |
72 |
|
def a(): print "blaa.a" |
73 |
|
def b(): print "blaa.b" |
74 |
|
|
75 |
|
[./program.py:] |
76 |
|
from . import * # can't import from . really, this line is pseudocode |
77 |
|
|
78 |
|
a() # the reader of program.py can not tell where a() |
79 |
|
b() # and b() are coming from. |
80 |
|
|
81 |
|
On the other hand, more verbose code is not always very elegant, eg:: |
82 |
|
|
83 |
|
[gzz/views/buoy/program.py:] |
84 |
|
import gzz.views.buoy |
85 |
|
|
86 |
|
gzz.views.buoy.a() |
87 |
|
gzz.views.buoy.b() |
88 |
|
|
89 |
|
[add something to conclude this] |
90 |
|
|
91 |
|
|
92 |
|
|
93 |
Changes |
Changes |
94 |
======= |
======= |
148 |
Notes |
Notes |
149 |
===== |
===== |
150 |
|
|
|
- items 8 and 9 are arbitrary choices for the sake of consistency |
|
|
|
|
151 |
- "A Foolish Consistency is the Hobgoblin of Little Minds" - Ralph Waldo Emerson |
- "A Foolish Consistency is the Hobgoblin of Little Minds" - Ralph Waldo Emerson |
152 |
|
|
153 |
|
|