who are looking at current code, they make take up bad habits that exist in the
current codebase.
+Python Version
+--------------
+
+Python 2.6 is the minimum supported version, since it is the first version to
+support Python 3 syntax. All exception handling should use Python 3 'except'
+syntax, and the print function should be used instead of Python 2's print
+statement (from __future__ import print_function).
+
+Dependencies
+------------
+
+Python and Bash should be the only hard dependencies. Any other dependencies,
+including external Python modules that are not included with Python itself,
+must be optionally enabled by run-time detection.
+
Tabs
----
This is why the python peps state spaces over tabs; because with spaces the line
wrapping is always clear (but you cannot convert spaces as easily as tabwidth).
-String
--------
-Try not to use the functions in the string module, they are deprecated.
-
-string.join(<iterable>," ")
-
-should be replaced with:
-
-" ".join(<iterable>)
-
-and:
-
-string.split(string, delimeter)
-
-should be replaced with:
-
-"somestring".split(delimeter)
-
-Nearly all other methods in string work on string objects and have similar calling
-conventions.
-
Comparisons
-----------
-if foo == None
+if foo != None
should be replaced with:
The NO example just imports a set of functions from the output module. It is
somewhat annoying because the import line needs to be modified when functions
are needed and often unused functions are left in the import line until someone
-comes along with a linter to clean up (does not happen often). The color is a
-bit clearer as
-
- print red('blar')
-
-is shorter than:
-
- print output.red('blar')
-
-Rationale: python -c 'import portage; dir(portage)' (circa 02/2008)
+comes along with a linter to clean up (does not happen often).