[Numpy-svn] r5717 - trunk/numpy/doc

numpy-svn@scip... numpy-svn@scip...
Wed Aug 27 16:49:46 CDT 2008


Author: ptvirtan
Date: 2008-08-27 16:49:40 -0500 (Wed, 27 Aug 2008)
New Revision: 5717

Modified:
   trunk/numpy/doc/__init__.py
Log:
Import documentation topic modules when numpy.doc is imported, so that they are easier to use. Add instructions how to view each topic.

Modified: trunk/numpy/doc/__init__.py
===================================================================
--- trunk/numpy/doc/__init__.py	2008-08-27 20:03:59 UTC (rev 5716)
+++ trunk/numpy/doc/__init__.py	2008-08-27 21:49:40 UTC (rev 5717)
@@ -6,7 +6,22 @@
            not f.startswith('__')]
 __all__.sort()
 
-__doc__ = 'The following topics are available:\n' + \
-          '\n - '.join([''] + __all__)
+for f in __all__:
+    __import__(__name__ + '.' + f)
 
+del f, ref_dir
+
+__doc__ = """\
+Topical documentation
+=====================
+
+The following topics are available:
+%s
+
+You can view them by
+
+>>> help(doc.TOPIC)
+
+""" % '\n- '.join([''] + __all__)
+
 __all__.extend(['__doc__'])



More information about the Numpy-svn mailing list