summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPauli Virtanen <pav@iki.fi>2010-02-20 18:13:40 +0000
committerPauli Virtanen <pav@iki.fi>2010-02-20 18:13:40 +0000
commit04d09a4c763e2d18c5939002d2390a607a75a05a (patch)
tree7320217c0c7cb50cd2c3c9b409f6f5e9f73c5b07
parent33d45c3ceb3871062d4af32ad368f0b732793938 (diff)
downloadnumpy-04d09a4c763e2d18c5939002d2390a607a75a05a.tar.gz
3K: ENH: core: alias __round__ -> round for the generic scalar type, for the round() builtin
-rw-r--r--numpy/core/src/multiarray/scalartypes.c.src6
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src
index fbe81abd4..e98805c1c 100644
--- a/numpy/core/src/multiarray/scalartypes.c.src
+++ b/numpy/core/src/multiarray/scalartypes.c.src
@@ -1625,6 +1625,12 @@ static PyMethodDef gentype_methods[] = {
{"round",
(PyCFunction)gentype_round,
METH_VARARGS | METH_KEYWORDS, NULL},
+#if defined(NPY_PY3K)
+ /* Hook for the round() builtin */
+ {"__round__",
+ (PyCFunction)gentype_round,
+ METH_VARARGS | METH_KEYWORDS, NULL},
+#endif
{"setflags",
(PyCFunction)gentype_setflags,
METH_VARARGS | METH_KEYWORDS, NULL},