[py-svn] r36381 - py/dist/py/documentation

cfbolz at codespeak.net cfbolz at codespeak.net
Tue Jan 9 18:19:09 CET 2007


Author: cfbolz
Date: Tue Jan  9 18:19:07 2007
New Revision: 36381

Modified:
   py/dist/py/documentation/TODO.txt
   py/dist/py/documentation/misc.txt
Log:
check in documentation about py.compat and py.builtin


Modified: py/dist/py/documentation/TODO.txt
==============================================================================
--- py/dist/py/documentation/TODO.txt	(original)
+++ py/dist/py/documentation/TODO.txt	Tue Jan  9 18:19:07 2007
@@ -14,10 +14,6 @@
 py.compat 
 -------------
 
-* (cfbolz) needs py/documentation/compat.txt 
-
-* (cfbolz) reimport/check python 2.4.4 modules 
-
 review all py lib documentation
 -------------------------------------
 

Modified: py/dist/py/documentation/misc.txt
==============================================================================
--- py/dist/py/documentation/misc.txt	(original)
+++ py/dist/py/documentation/misc.txt	Tue Jan  9 18:19:07 2007
@@ -169,3 +169,39 @@
             return p 
     binsvn = py.path.local.sysfind('svn', checker=mysvn) 
 
+
+
+Python version compatibility helpers
+=====================================
+
+The py-lib contains some helpers that make writing scripts that work on various
+Python versions easier.
+
+``py.compat``
+-------------
+
+``py.compat`` provides fixed versions (currently from Python 2.4.4) of various
+newer modules to be able to use them in various Python versions. Currently these
+are:
+
+ * doctest
+ * optparse
+ * subprocess
+ * textwrap
+
+They are used by replacing the normal ``import ...`` byr
+``from py.compat import ...``.
+
+``py.builtin``
+--------------
+
+``py.builtin`` provides various builtins that were added in later Python
+versions. If the used Python version used does not provide these builtins, they
+are pure-Python reimplementations. These currently are:
+
+ * enumerate
+ * reversed
+ * sorted
+ * BaseException
+
+``py.builtin.BaseException`` is just ``Exception`` before Python 2.5.


More information about the py-svn mailing list