diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/_ufunc_config.py | 7 | ||||
-rw-r--r-- | numpy/core/_ufunc_config.pyi | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/abstractdtypes.h | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/numpy/core/_ufunc_config.py b/numpy/core/_ufunc_config.py index eb69b9c34..7f9995fa3 100644 --- a/numpy/core/_ufunc_config.py +++ b/numpy/core/_ufunc_config.py @@ -454,12 +454,11 @@ NO_NEP50_WARNING = contextvars.ContextVar("_no_nep50_warning", default=False) def _no_nep50_warning(): """ Context manager to disable NEP 50 warnings. This context manager is - only relevant if the NEP 50 warnings are enabled globally (which is NOT + only relevant if the NEP 50 warnings are enabled globally (which is not thread/context safe). - On the other hand, this warning suppression is safe. + + This warning context manager itself is fully safe, however. """ - # TODO: We could skip the manager entirely if NumPy as a whole is not - # in the warning mode. (Which is NOT thread/context safe.) token = NO_NEP50_WARNING.set(True) try: yield diff --git a/numpy/core/_ufunc_config.pyi b/numpy/core/_ufunc_config.pyi index 76177f6b3..f56504507 100644 --- a/numpy/core/_ufunc_config.pyi +++ b/numpy/core/_ufunc_config.pyi @@ -34,4 +34,4 @@ def seterrcall( ) -> None | _ErrFunc | _SupportsWrite[str]: ... def geterrcall() -> None | _ErrFunc | _SupportsWrite[str]: ... -# See `numpy/__init__.pyi` for the `errstate` class and `no_nep5_warnings`
\ No newline at end of file +# See `numpy/__init__.pyi` for the `errstate` class and `no_nep5_warnings` diff --git a/numpy/core/src/multiarray/abstractdtypes.h b/numpy/core/src/multiarray/abstractdtypes.h index b3f547b64..6901ec213 100644 --- a/numpy/core/src/multiarray/abstractdtypes.h +++ b/numpy/core/src/multiarray/abstractdtypes.h @@ -41,7 +41,7 @@ npy_mark_tmp_array_if_pyscalar( * Further, `np.float64` is a double subclass, so must reject it. */ if (PyLong_Check(obj) - && (PyArray_ISINTEGER(arr) || PyArray_ISOBJECT(arr))) { + && (PyArray_ISINTEGER(arr) || PyArray_ISOBJECT(arr))) { ((PyArrayObject_fields *)arr)->flags |= NPY_ARRAY_WAS_PYTHON_INT; if (dtype != NULL) { Py_INCREF(&PyArray_PyIntAbstractDType); |