[pypy-commit] pypy remove-numpypy: add some types to the dummy test module

bdkearns noreply at buildbot.pypy.org
Wed Oct 30 02:50:28 CET 2013


Author: Brian Kearns <bdkearns at gmail.com>
Branch: remove-numpypy
Changeset: r67721:ce531180fd41
Date: 2013-10-29 21:16 -0400
http://bitbucket.org/pypy/pypy/changeset/ce531180fd41/

Log:	add some types to the dummy test module

diff --git a/pypy/module/micronumpy/test/dummy_module.py b/pypy/module/micronumpy/test/dummy_module.py
--- a/pypy/module/micronumpy/test/dummy_module.py
+++ b/pypy/module/micronumpy/test/dummy_module.py
@@ -1,7 +1,30 @@
 from _numpypy.multiarray import *
 from _numpypy.umath import *
 
-True_ = dtype('bool').type(True)
-False_ = dtype('bool').type(False)
 newaxis = None
 ufunc = type(sin)
+
+types = ['bool8', 'byte', 'ubyte', 'short', 'ushort', 'longlong', 'ulonglong',
+         'single', 'longfloat', 'longdouble', 'csingle', 'cfloat', 'void']
+for t in ('int', 'uint'):
+    for s in (8, 16, 32, 64, 'p'):
+        types.append(t + str(s))
+for s in (16, 32, 64):
+    types.append('float' + str(s))
+for s in (64, 128):
+    types.append('complex' + str(s))
+for t in types:
+    globals()[t] = dtype(t).type
+
+types = ['bool', 'int', 'float', 'complex', 'str', 'unicode']
+for t in types:
+    globals()[t + '_'] = dtype(t).type
+del types
+
+types = ['Generic', 'Number', 'Integer', 'SignedInteger', 'UnsignedInteger',
+         'Inexact', 'Floating', 'ComplexFloating', 'Character']
+for t in types:
+    globals()[t.lower()] = typeinfo[t]
+
+True_ = bool_(True)
+False_ = bool_(False)


More information about the pypy-commit mailing list