[pypy-commit] pypy default: define this at app-level like numpy
bdkearns
noreply at buildbot.pypy.org
Mon Feb 25 14:12:13 CET 2013
Author: Brian Kearns <bdkearns at gmail.com>
Branch:
Changeset: r61753:070c49864f5e
Date: 2013-02-25 05:50 -0500
http://bitbucket.org/pypy/pypy/changeset/070c49864f5e/
Log: define this at app-level like numpy
diff --git a/lib_pypy/numpypy/core/numeric.py b/lib_pypy/numpypy/core/numeric.py
--- a/lib_pypy/numpypy/core/numeric.py
+++ b/lib_pypy/numpypy/core/numeric.py
@@ -1,4 +1,5 @@
__all__ = [
+ 'ufunc',
'asanyarray', 'base_repr',
'array_repr', 'array_str', 'set_string_function',
'array_equal', 'asarray', 'outer', 'identity', 'little_endian',
@@ -6,7 +7,7 @@
]
from _numpypy import array, ndarray, int_, float_, bool_, flexible #, complex_# , longlong
-from _numpypy import concatenate
+from _numpypy import concatenate, sin
from .fromnumeric import any
import sys
import multiarray
@@ -14,6 +15,8 @@
from umath import *
from numpypy.core.arrayprint import array2string
+ufunc = type(sin)
+
def extend_all(module):
adict = {}
for a in __all__:
diff --git a/pypy/module/micronumpy/__init__.py b/pypy/module/micronumpy/__init__.py
--- a/pypy/module/micronumpy/__init__.py
+++ b/pypy/module/micronumpy/__init__.py
@@ -8,7 +8,6 @@
interpleveldefs = {
'ndarray': 'interp_numarray.W_NDimArray',
'dtype': 'interp_dtype.W_Dtype',
- 'ufunc': 'interp_ufuncs.W_Ufunc',
'array': 'interp_numarray.array',
'zeros': 'interp_numarray.zeros',
diff --git a/pypy/module/micronumpy/test/test_ufuncs.py b/pypy/module/micronumpy/test/test_ufuncs.py
--- a/pypy/module/micronumpy/test/test_ufuncs.py
+++ b/pypy/module/micronumpy/test/test_ufuncs.py
@@ -16,7 +16,7 @@
cls.w_isWindows = cls.space.wrap(os.name == 'nt')
def test_ufunc_instance(self):
- from _numpypy import add, ufunc
+ from numpypy import add, ufunc
assert isinstance(add, ufunc)
assert repr(add) == "<ufunc 'add'>"
More information about the pypy-commit
mailing list