diff options
author | Mark Wiebe <mwiebe@enthought.com> | 2011-06-03 18:30:10 -0500 |
---|---|---|
committer | Mark Wiebe <mwiebe@enthought.com> | 2011-06-22 09:09:07 -0500 |
commit | eb6c0515443bbab21afb220e27230c727e7c5b06 (patch) | |
tree | 6fa544405fccd504dc6b83081474b48e13f172fd /numpy | |
parent | d4ea04b4531f218bd7752f675c30b8c8472a5243 (diff) | |
download | numpy-eb6c0515443bbab21afb220e27230c727e7c5b06.tar.gz |
ENH: core: Change the default casting rule from 'unsafe' to 'same_kind'
This is an experimental change, to see what kind of ripple effects
tightening up the semantics of NumPy just a little bit produce.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/src/umath/ufunc_object.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c index dcc29f2ba..b26221e23 100644 --- a/numpy/core/src/umath/ufunc_object.c +++ b/numpy/core/src/umath/ufunc_object.c @@ -3486,11 +3486,9 @@ PyUFunc_GeneralizedFunction(PyUFuncObject *self, NPY_ORDER order = NPY_KEEPORDER; /* - * Many things in NumPy do unsafe casting (doing int += float, etc). - * The strictness should probably become a state parameter, similar - * to the seterr/geterr. + * Currently trying out SAME_KIND casting rule by default. */ - NPY_CASTING casting = NPY_UNSAFE_CASTING; + NPY_CASTING casting = NPY_SAME_KIND_CASTING; /* When provided, extobj and typetup contain borrowed references */ PyObject *extobj = NULL, *type_tup = NULL; @@ -3870,11 +3868,9 @@ PyUFunc_GenericFunction(PyUFuncObject *self, NPY_ORDER order = NPY_KEEPORDER; /* - * Many things in NumPy do unsafe casting (doing int += float, etc). - * The strictness should probably become a state parameter, similar - * to the seterr/geterr. + * Currently trying out SAME_KIND casting rule by default. */ - NPY_CASTING casting = NPY_UNSAFE_CASTING; + NPY_CASTING casting = NPY_SAME_KIND_CASTING; /* When provided, extobj and typetup contain borrowed references */ PyObject *extobj = NULL, *type_tup = NULL; |