[pypy-commit] pypy python-numpy: fake missing dtypes
mattip
noreply at buildbot.pypy.org
Fri Aug 17 14:06:53 CEST 2012
Author: Matti Picus <matti.picus at gmail.com>
Branch: python-numpy
Changeset: r56735:d30cbc4026fd
Date: 2012-08-17 07:43 +0300
http://bitbucket.org/pypy/pypy/changeset/d30cbc4026fd/
Log: fake missing dtypes
diff --git a/lib_pypy/numpypy/numerictypes.py b/lib_pypy/numpypy/numerictypes.py
--- a/lib_pypy/numpypy/numerictypes.py
+++ b/lib_pypy/numpypy/numerictypes.py
@@ -412,9 +412,11 @@
for alias, t in type_pairs:
try:
allTypes[alias] = allTypes[t]
- sctypeDict[alias] = sctypeDict[t]
except KeyError:
- print 'dtype',t,'not implemented in numpypy, will be missing in numerictypes.sctypeDict'
+ print 'dtype',t,"not implemented in numpypy, using dtype('void') instead"
+ allTypes[t] = allTypes['void']
+ allTypes[alias] = allTypes[t]
+ sctypeDict[alias] = sctypeDict['void']
# Remove aliases overriding python types and modules
to_remove = ['ulong', 'object', 'unicode', 'int', 'long', 'float',
'complex', 'bool', 'string', 'datetime', 'timedelta']
@@ -900,10 +902,7 @@
if isinstance(name, tuple):
sctypeDict[name[0]] = name[1]
else:
- try:
- sctypeDict[name] = allTypes['%s_' % name]
- except:
- print 'dtype',name,'not implemented, not assigned in numerictypes.sctypeDict'
+ sctypeDict[name] = allTypes['%s_' % name]
del _toadd, name
@@ -914,6 +913,8 @@
del key
+complex_ = dtype('void')
+
typecodes = {'Character':'c',
'Integer':'bhilqp',
'UnsignedInteger':'BHILQP',
More information about the pypy-commit
mailing list