diff options
| author | fuzzyray <fuzzyray@gentoo.org> | 2010-01-06 15:54:37 +0000 |
|---|---|---|
| committer | fuzzyray <fuzzyray@gentoo.org> | 2010-01-06 15:54:37 +0000 |
| commit | 2212da8d45f122c17fce56ed0c1bc57d4387f95c (patch) | |
| tree | 125b3a08ba1e9e84902ee5dfd3b24bdb78d304c2 /DEVELOPING | |
| parent | a77e5086c73265171363b1389c61c6ee8c4ac520 (diff) | |
| download | gentoolkit-2212da8d45f122c17fce56ed0c1bc57d4387f95c.tar.gz | |
Merge genscripts revision 144, contains fixes for Bug 299260
svn path=/trunk/gentoolkit/; revision=729
Diffstat (limited to 'DEVELOPING')
| -rw-r--r-- | DEVELOPING | 19 |
1 files changed, 7 insertions, 12 deletions
@@ -1,5 +1,5 @@ Python Code Guidelines ---------------- +---------------------- These are a few guidelines to stick to when modifying or adding code to Gentoolkit. These guidelines do not apply to pym/gentoolkit/test/*. @@ -33,7 +33,7 @@ Line-Wrapping ... ) -- Max. line length is strictly 80 characters with a tab length of 4 characters. +- Preferred line length is 80 characters with a tab length of 4 characters. - "The preferred way of wrapping long lines is by using Python's implied line continuation inside parentheses, brackets and braces" rather than using '\' (PEP 8). @@ -47,12 +47,12 @@ Line-Wrapping self._descriptions = \ [e.text for e in self._xml_tree.findall("longdescription")] - BETTER: + OK: self._descriptions = [ e.text for e in self._xml_tree.findall("longdescription") ] - BEST: (easiest to read and test) + OK: (easiest to read and test) long_descriptions = self._xml_tree.findall("longdescription") self._descriptions = [e.text for e in long_descriptions] @@ -153,14 +153,9 @@ something tricky about them, though. Other concerns: --------------- - Choose names which are full, clear words (not necessary in small loops). -- It is NEVER necessary to prefix names with "my". Consider: - class FooThinger(object): - def __init__(self, foo): - self.myfoo = foo - - Just use FooThinger.foo or FooThinger.orig_foo; "my"foo tells us nothing. +- It is NEVER necessary to prefix names with "my". It adds no useful + information. - Comment and document in simple, unambiguous and non-repetitive English. - When adding a TODO, FIXME or XXX comment, please date it and add your name so that other devs know who to ask about the proposed change. -- Be careful of spelling. DO spell check your source code and be professional - when writing comments. +- Be careful of spelling. |
