[Numpy-svn] r5043 - trunk/numpy/core

numpy-svn@scip... numpy-svn@scip...
Fri Apr 18 01:42:51 CDT 2008


Author: cookedm
Date: 2008-04-18 01:42:49 -0500 (Fri, 18 Apr 2008)
New Revision: 5043

Modified:
   trunk/numpy/core/numerictypes.py
Log:
Add comments to numerictypes.py about what the 'kind' field of dtypes can be
(Also see the DtypesKind page on the numpy wiki)


Modified: trunk/numpy/core/numerictypes.py
===================================================================
--- trunk/numpy/core/numerictypes.py	2008-04-17 20:51:03 UTC (rev 5042)
+++ trunk/numpy/core/numerictypes.py	2008-04-18 06:42:49 UTC (rev 5043)
@@ -38,8 +38,8 @@
    As part of the type-hierarchy:    xx -- is bit-width
 
    generic
-     +-> bool_
-     +-> number
+     +-> bool_                                  (kind=b)
+     +-> number                                 (kind=i)
      |     integer
      |     signedinteger   (intxx)
      |     byte
@@ -48,7 +48,7 @@
      |     intp           int0
      |     int_
      |     longlong
-     +-> unsignedinteger  (uintxx)
+     +-> unsignedinteger  (uintxx)              (kind=u)
      |     ubyte
      |     ushort
      |     uintc
@@ -56,23 +56,21 @@
      |     uint_
      |     ulonglong
      +-> inexact
-     |   +-> floating           (floatxx)
+     |   +-> floating           (floatxx)       (kind=f)
      |   |     single
      |   |     float_  (double)
      |   |     longfloat
-     |   \-> complexfloating    (complexxx)
+     |   \-> complexfloating    (complexxx)     (kind=c)
      |         csingle  (singlecomplex)
      |         complex_ (cfloat, cdouble)
      |         clongfloat (longcomplex)
      +-> flexible
      |     character
-     |     str_     (string_)
-     |     unicode_
-     |     void
+     |     str_     (string_)                   (kind=S)
+     |     unicode_                             (kind=U)
+     |     void                                 (kind=V)
      |
-     \-> object_ (not used much)
-
-$Id: numerictypes.py,v 1.17 2005/09/09 22:20:06 teoliphant Exp $
+     \-> object_ (not used much)                (kind=O)
 """
 
 # we add more at the bottom
@@ -579,6 +577,15 @@
 typeDict = sctypeDict
 typeNA = sctypeNA
 
+# b -> boolean
+# u -> unsigned integer
+# i -> signed integer
+# f -> floating point
+# c -> complex
+# S -> string
+# U -> Unicode string
+# V -> record
+# O -> Python object
 _kind_list = ['b', 'u', 'i', 'f', 'c', 'S', 'U', 'V', 'O']
 
 __test_types = typecodes['AllInteger'][:-2]+typecodes['AllFloat']+'O'



More information about the Numpy-svn mailing list