summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorcookedm <cookedm@localhost>2008-04-18 06:42:49 +0000
committercookedm <cookedm@localhost>2008-04-18 06:42:49 +0000
commit44e4ead674e12013b4e34b5a99f545fab64116e3 (patch)
tree37dc3b2fbd6969b3f0922491709b6f245adbb98c /numpy
parente653089a814b89dc73c08123ded75af4d3b37d17 (diff)
downloadnumpy-44e4ead674e12013b4e34b5a99f545fab64116e3.tar.gz
Add comments to numerictypes.py about what the 'kind' field of dtypes can be
(Also see the DtypesKind page on the numpy wiki)
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/numerictypes.py29
1 files changed, 18 insertions, 11 deletions
diff --git a/numpy/core/numerictypes.py b/numpy/core/numerictypes.py
index 63d30013b..ae0b57eec 100644
--- a/numpy/core/numerictypes.py
+++ b/numpy/core/numerictypes.py
@@ -38,8 +38,8 @@ Exported symbols include:
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 @@ Exported symbols include:
| intp int0
| int_
| longlong
- +-> unsignedinteger (uintxx)
+ +-> unsignedinteger (uintxx) (kind=u)
| ubyte
| ushort
| uintc
@@ -56,23 +56,21 @@ Exported symbols include:
| 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 @@ typecodes = {'Character':'c',
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'