[Numpy-svn] r8304 - trunk/numpy/lib

numpy-svn@scip... numpy-svn@scip...
Wed Mar 24 22:32:15 CDT 2010


Author: charris
Date: 2010-03-24 22:32:15 -0500 (Wed, 24 Mar 2010)
New Revision: 8304

Modified:
   trunk/numpy/lib/npyio.py
Log:
CLN: Small cleanups. Fix docstring examples.

Modified: trunk/numpy/lib/npyio.py
===================================================================
--- trunk/numpy/lib/npyio.py	2010-03-25 03:32:12 UTC (rev 8303)
+++ trunk/numpy/lib/npyio.py	2010-03-25 03:32:15 UTC (rev 8304)
@@ -1,10 +1,6 @@
-__all__ = ['savetxt', 'loadtxt',
-           'genfromtxt', 'ndfromtxt', 'mafromtxt', 'recfromtxt', 'recfromcsv',
-           'load', 'loads',
-           'save', 'savez',
-           'packbits', 'unpackbits',
-           'fromregex',
-           'DataSource']
+__all__ = ['savetxt', 'loadtxt', 'genfromtxt', 'ndfromtxt', 'mafromtxt',
+        'recfromtxt', 'recfromcsv', 'load', 'loads', 'save', 'savez',
+        'packbits', 'unpackbits', 'fromregex', 'DataSource']
 
 import numpy as np
 import format
@@ -27,8 +23,7 @@
 from numpy.compat import asbytes, asstr, asbytes_nested, bytes
 
 if sys.version_info[0] >= 3:
-    import io
-    BytesIO = io.BytesIO
+    from io import BytesIO
 else:
     from cStringIO import StringIO as BytesIO
 
@@ -93,7 +88,7 @@
     ...         return key
     ...
     >>> demo_obj = BagDemo()
-    >>> bagobj = np.lib.io.BagObj(demo_obj)
+    >>> bagobj = np.lib.npyio.BagObj(demo_obj)
     >>> bagobj.some_item
     'some_item'
 
@@ -149,7 +144,7 @@
     >>> outfile.seek(0)
 
     >>> npz = np.load(outfile)
-    >>> isinstance(npz, np.lib.io.NpzFile)
+    >>> isinstance(npz, np.lib.npyio.NpzFile)
     True
     >>> npz.files
     ['y', 'x']



More information about the Numpy-svn mailing list