diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2018-09-29 13:25:05 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2018-09-29 13:25:05 +0200 |
commit | f75b8e8fc8ea3842cbf3ae22716fc5c3b4b96102 (patch) | |
tree | 2af86c3ecc9a3c4391e3c62d1f4e603baf64ab13 | |
parent | bd8dab8404ee8f78ed240c936873aeb5c96c6d54 (diff) | |
download | cython-f75b8e8fc8ea3842cbf3ae22716fc5c3b4b96102.tar.gz |
Enable "check_size=False" for the NumPy ndarray and dtype extension types to avoid warning about otherwise backwards compatible changes.0.29rc2
-rw-r--r-- | CHANGES.rst | 4 | ||||
-rw-r--r-- | Cython/Includes/numpy/__init__.pxd | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index dbcbeae28..bdffed8cb 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -159,6 +159,10 @@ Bugs fixed ``c_string_encoding`` directive appeared within the first two lines. (Github issue #2632) +* Cython generated modules no longer emit a warning during import when the + size of the NumPy array type is larger than what was found at compile time. + Instead, this is assumed to be a backwards compatible change on NumPy side. + Other changes ------------- diff --git a/Cython/Includes/numpy/__init__.pxd b/Cython/Includes/numpy/__init__.pxd index eda0b240d..11eee4e6e 100644 --- a/Cython/Includes/numpy/__init__.pxd +++ b/Cython/Includes/numpy/__init__.pxd @@ -203,7 +203,7 @@ cdef extern from "numpy/arrayobject.h": ctypedef struct PyArray_Descr: pass - ctypedef class numpy.dtype [object PyArray_Descr]: + ctypedef class numpy.dtype [object PyArray_Descr, check_size False]: # Use PyDataType_* macros when possible, however there are no macros # for accessing some of the fields, so some are defined. cdef PyTypeObject* typeobj @@ -239,7 +239,7 @@ cdef extern from "numpy/arrayobject.h": # like PyArrayObject**. pass - ctypedef class numpy.ndarray [object PyArrayObject]: + ctypedef class numpy.ndarray [object PyArrayObject, check_size False]: cdef __cythonbufferdefaults__ = {"mode": "strided"} cdef: |