Author: Alex Gaynor <[email protected]>
Branch:
Changeset: r47809:d63bd644f1cd
Date: 2011-10-03 17:19 -0400
http://bitbucket.org/pypy/pypy/changeset/d63bd644f1cd/
Log: added numpy.e
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
@@ -53,4 +53,5 @@
'average': 'app_numpy.average',
'mean': 'app_numpy.mean',
'inf': 'app_numpy.inf',
+ 'e': 'app_numpy.e',
}
diff --git a/pypy/module/micronumpy/app_numpy.py
b/pypy/module/micronumpy/app_numpy.py
--- a/pypy/module/micronumpy/app_numpy.py
+++ b/pypy/module/micronumpy/app_numpy.py
@@ -1,7 +1,10 @@
+import math
+
import numpy
inf = float("inf")
+e = math.e
def average(a):
# This implements a weighted average, for now we don't implement the
diff --git a/pypy/module/micronumpy/test/test_module.py
b/pypy/module/micronumpy/test/test_module.py
--- a/pypy/module/micronumpy/test/test_module.py
+++ b/pypy/module/micronumpy/test/test_module.py
@@ -12,7 +12,10 @@
assert average(range(10)) == 4.5
assert average(array(range(10))) == 4.5
- def test_inf(self):
- from numpy import inf
+ def test_constants(self):
+ import math
+ from numpy import inf, e
assert type(inf) is float
- assert inf == float("inf")
\ No newline at end of file
+ assert inf == float("inf")
+ assert e == math.e
+ assert type(e) is float
\ No newline at end of file
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit