summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2020-03-19 01:47:58 -0600
committerGitHub <noreply@github.com>2020-03-19 08:47:58 +0100
commit4c7bd3c8e72acd6560cd9b42acaac0c4dac63c4e (patch)
treee4f0f9fd1758739f0a2241d1c87ae8193f01b2bc
parentc5f2231ec462f23f53d5ec8d0963f8da6b7145cf (diff)
downloadcython-4c7bd3c8e72acd6560cd9b42acaac0c4dac63c4e.tar.gz
Add some missing Py3.3+ declarations to object.pxd (GH-3445)
-rw-r--r--Cython/Includes/cpython/object.pxd18
1 files changed, 18 insertions, 0 deletions
diff --git a/Cython/Includes/cpython/object.pxd b/Cython/Includes/cpython/object.pxd
index 471281863..aa625523d 100644
--- a/Cython/Includes/cpython/object.pxd
+++ b/Cython/Includes/cpython/object.pxd
@@ -132,6 +132,17 @@ cdef extern from "Python.h":
# failure. This is the equivalent of the Python statement "del
# o.attr_name".
+ object PyObject_GenericGetDict(object o, void *context)
+ # Return value: New reference.
+ # A generic implementation for the getter of a __dict__ descriptor. It
+ # creates the dictionary if necessary.
+ # New in version 3.3.
+
+ int PyObject_GenericSetDict(object o, object value, void *context) except -1
+ # A generic implementation for the setter of a __dict__ descriptor. This
+ # implementation does not allow the dictionary to be deleted.
+ # New in version 3.3.
+
int Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE
object PyObject_RichCompare(object o1, object o2, int opid)
@@ -332,6 +343,13 @@ cdef extern from "Python.h":
# returned. On error, -1 is returned. This is the equivalent to
# the Python expression "len(o)".
+ Py_ssize_t PyObject_LengthHint(object o, Py_ssize_t default) except -1
+ # Return an estimated length for the object o. First try to return its
+ # actual length, then an estimate using __length_hint__(), and finally
+ # return the default value. On error, return -1. This is the equivalent to
+ # the Python expression "operator.length_hint(o, default)".
+ # New in version 3.4.
+
object PyObject_GetItem(object o, object key)
# Return value: New reference.
# Return element of o corresponding to the object key or NULL on