summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bradshaw <robertwb@gmail.com>2018-10-02 11:59:06 +0200
committerRobert Bradshaw <robertwb@gmail.com>2018-10-02 11:59:06 +0200
commitfbd2fd09d099f51db44c28a768812758222b9208 (patch)
tree2553ba4744ea01aa772d3ea26340122e8e95ffa7
parentc9eda12b4806fba3931f7b791be7a672c92d9ca0 (diff)
downloadcython-fbd2fd09d099f51db44c28a768812758222b9208.tar.gz
Rename check_size extend option to ignore.
-rw-r--r--Cython/Compiler/ModuleNode.py2
-rw-r--r--Cython/Compiler/Nodes.py2
-rw-r--r--Cython/Compiler/Parsing.py4
-rw-r--r--Cython/Compiler/PyrexTypes.py2
-rw-r--r--Cython/Includes/numpy/__init__.pxd4
-rw-r--r--docs/src/userguide/extension_types.rst4
-rw-r--r--tests/run/check_size.srctree8
7 files changed, 13 insertions, 13 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
index c86a12263..a9955326a 100644
--- a/Cython/Compiler/ModuleNode.py
+++ b/Cython/Compiler/ModuleNode.py
@@ -3066,7 +3066,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
cs = 0
elif type.check_size == 'warn':
cs = 1
- elif type.check_size == 'extend':
+ elif type.check_size == 'ignore':
cs = 2
else:
raise RuntimeError("invalid value for check_size '%s' when compiling %s.%s" % (
diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py
index 48287b3fa..439a1fde6 100644
--- a/Cython/Compiler/Nodes.py
+++ b/Cython/Compiler/Nodes.py
@@ -4630,7 +4630,7 @@ class CClassDefNode(ClassDefNode):
# bases TupleNode Base class(es)
# objstruct_name string or None Specified C name of object struct
# typeobj_name string or None Specified C name of type object
- # check_size 'warn', 'error', 'extend' What to do if tp_basicsize does not match
+ # check_size 'warn', 'error', 'ignore' What to do if tp_basicsize does not match
# in_pxd boolean Is in a .pxd file
# decorators [DecoratorNode] list of decorators or None
# doc string or None
diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py
index 79dd1e04c..a906f6656 100644
--- a/Cython/Compiler/Parsing.py
+++ b/Cython/Compiler/Parsing.py
@@ -3545,8 +3545,8 @@ def p_c_class_options(s):
elif s.systring == 'check_size':
s.next()
check_size = p_ident(s)
- if check_size not in ('extend', 'warn', 'error'):
- s.error("Expected one of extend, warn or error, found %r" % check_size)
+ if check_size not in ('ignore', 'warn', 'error'):
+ s.error("Expected one of ignore, warn or error, found %r" % check_size)
if s.sy != ',':
break
s.next()
diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py
index f924e01b2..ac5913f9a 100644
--- a/Cython/Compiler/PyrexTypes.py
+++ b/Cython/Compiler/PyrexTypes.py
@@ -1345,7 +1345,7 @@ class PyExtensionType(PyObjectType):
# vtable_cname string Name of C method table definition
# early_init boolean Whether to initialize early (as opposed to during module execution).
# defered_declarations [thunk] Used to declare class hierarchies in order
- # check_size 'warn', 'error', 'extend' What to do if tp_basicsize does not match
+ # check_size 'warn', 'error', 'ignore' What to do if tp_basicsize does not match
is_extension_type = 1
has_attributes = 1
diff --git a/Cython/Includes/numpy/__init__.pxd b/Cython/Includes/numpy/__init__.pxd
index 4e5b15d4d..789669dac 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, check_size extend]:
+ ctypedef class numpy.dtype [object PyArray_Descr, check_size ignore]:
# 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, check_size extend]:
+ ctypedef class numpy.ndarray [object PyArrayObject, check_size ignore]:
cdef __cythonbufferdefaults__ = {"mode": "strided"}
cdef:
diff --git a/docs/src/userguide/extension_types.rst b/docs/src/userguide/extension_types.rst
index b9cf890fb..63b407871 100644
--- a/docs/src/userguide/extension_types.rst
+++ b/docs/src/userguide/extension_types.rst
@@ -771,11 +771,11 @@ Where:
- ``object_struct_name`` is the name to assume for the type's C struct.
- ``type_object_name`` is the name to assume for the type's statically
declared type object.
-- ``cs_option`` is ``warn`` (the default), ``error``, or ``extend`` and is only
+- ``cs_option`` is ``warn`` (the default), ``error``, or ``ignore`` and is only
used for external extension types. If ``error``, the ``sizeof(object_struct)``
that was found at compile time must match the type's runtime ``tp_basicsize``
exactly, otherwise the module import will fail with an error. If ``warn``
- or ``extend``, the ``object_struct`` is allowed to be smaller than the type's
+ or ``ignore``, the ``object_struct`` is allowed to be smaller than the type's
``tp_basicsize``, which indicates the runtime type may be part of an updated
module, and that the external module's developers extended the object in a
backward-compatible fashion (only adding new fields to the end of the object).
diff --git a/tests/run/check_size.srctree b/tests/run/check_size.srctree
index 4d82dd15d..f2f13a575 100644
--- a/tests/run/check_size.srctree
+++ b/tests/run/check_size.srctree
@@ -139,12 +139,12 @@ cdef extern from "check_size_smaller.h":
cpdef public int testme(Foo f) except -1:
return f.f9
-######## _check_size_extend.pyx ########
+######## _check_size_ignore.pyx ########
cdef extern from "check_size_smaller.h":
# Allow size to be larger
- ctypedef class check_size.Foo [object FooStructSmall, check_size extend]:
+ ctypedef class check_size.Foo [object FooStructSmall, check_size ignore]:
cdef:
int f9
@@ -220,10 +220,10 @@ assert ret == 23
with warnings.catch_warnings(record=True) as w:
# No warning, runtime vendor must provide backward compatibility
- import _check_size_extend
+ import _check_size_ignore
assert len(w) == 0
-ret = _check_size_extend.testme(foo)
+ret = _check_size_ignore.testme(foo)
assert ret == 23
try: