[pypy-commit] pypy numpy-dtype-alt: cmp isn't rpython, apparently
alex_gaynor
noreply at buildbot.pypy.org
Thu Aug 25 06:44:12 CEST 2011
Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: numpy-dtype-alt
Changeset: r46766:92d7c61d75ca
Date: 2011-08-25 00:34 -0400
http://bitbucket.org/pypy/pypy/changeset/92d7c61d75ca/
Log: cmp isn't rpython, apparently
diff --git a/pypy/module/micronumpy/interp_dtype.py b/pypy/module/micronumpy/interp_dtype.py
--- a/pypy/module/micronumpy/interp_dtype.py
+++ b/pypy/module/micronumpy/interp_dtype.py
@@ -240,7 +240,13 @@
@unaryop
def sign(self, v):
- return cmp(v, 0)
+ if v > 0:
+ return 1
+ elif v < 0:
+ return -1
+ else:
+ assert v == 0
+ return 0
def str_format(self, item):
return str(widen(self.unbox(item)))
More information about the pypy-commit
mailing list