[pypy-commit] pypy missing-ndarray-attributes: simplify, the problem is probably not here anyway
mattip
noreply at buildbot.pypy.org
Tue Jan 29 16:01:25 CET 2013
Author: mattip
Branch: missing-ndarray-attributes
Changeset: r60689:0e05cbe257dc
Date: 2013-01-29 17:02 +0200
http://bitbucket.org/pypy/pypy/changeset/0e05cbe257dc/
Log: simplify, the problem is probably not here anyway
diff --git a/pypy/module/micronumpy/arrayimpl/sort.py b/pypy/module/micronumpy/arrayimpl/sort.py
--- a/pypy/module/micronumpy/arrayimpl/sort.py
+++ b/pypy/module/micronumpy/arrayimpl/sort.py
@@ -82,23 +82,14 @@
def argsort_array(arr, space, w_axis):
itemtype = arr.dtype.itemtype
- # this is for runtime - written like this to simplify
- # logic since translation could not handle it as one
- # statement
- if arr.dtype.is_int_type():
- pass
- elif arr.dtype.is_float_type():
- pass
- elif arr.dtype.is_complex_type():
- pass
+ if isinstance(itemtype, types.Float) or \
+ isinstance(itemtype, types.Integer) or \
+ isinstance(itemtype, types.ComplexFloating):
+ pass
else:
raise OperationError(space.w_NotImplementedError,
space.wrap("sorting of non-numeric types " + \
"'%s' is not implemented" % arr.dtype.get_name() ))
- # this is for translation
- assert isinstance(itemtype, types.Float) or \
- isinstance(itemtype, types.Integer) or \
- isinstance(itemtype, types.ComplexFloating)
if w_axis is space.w_None:
# note that it's fine ot pass None here as we're not going
# to pass the result around (None is the link to base in slices)
More information about the pypy-commit
mailing list