[Numpy-svn] r6465 - trunk/numpy

numpy-svn@scip... numpy-svn@scip...
Tue Feb 24 14:53:11 CST 2009


Author: matthew.brett@gmail.com
Date: 2009-02-24 14:53:10 -0600 (Tue, 24 Feb 2009)
New Revision: 6465

Modified:
   trunk/numpy/add_newdocs.py
Log:
Added docstring for isbuiltin

Modified: trunk/numpy/add_newdocs.py
===================================================================
--- trunk/numpy/add_newdocs.py	2009-02-23 19:02:43 UTC (rev 6464)
+++ trunk/numpy/add_newdocs.py	2009-02-24 20:53:10 UTC (rev 6465)
@@ -2937,7 +2937,7 @@
 
 add_newdoc('numpy.core.multiarray', 'dtype', ('byteorder',
     '''
-    dt.byteorder
+    byteorder
 
     String giving byteorder of dtype
 
@@ -2995,6 +2995,33 @@
 
 add_newdoc('numpy.core.multiarray', 'dtype', ('isbuiltin',
     """
+    isbuiltin
+
+    Value identifying if numpy dtype is a numpy builtin type
+
+    Read-only
+
+    Returns
+    -------
+    val : {0,1,2}
+       0 if this is a structured array type, with fields
+       1 if this is a dtype compiled into numpy (such as ints, floats etc)
+       2 if the dtype is for a user-defined numpy type
+         A user-defined type uses the numpy C-API machinery to extend
+         numpy to handle a new array type.  See the Guide to Numpy for
+         details.
+
+    Examples
+    --------
+    >>> dt = np.dtype('i2')
+    >>> dt.isbuiltin
+    1
+    >>> dt = np.dtype('f8')
+    >>> dt.isbuiltin
+    1
+    >>> dt = np.dtype([('field1', 'f8')])
+    >>> dt.isbuiltin
+    0
     """))
 
 add_newdoc('numpy.core.multiarray', 'dtype', ('isnative',



More information about the Numpy-svn mailing list