diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/tools/cython/Cython/Includes/cpython | |
parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
download | ydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/cython/Cython/Includes/cpython')
27 files changed, 548 insertions, 548 deletions
diff --git a/contrib/tools/cython/Cython/Includes/cpython/array.pxd b/contrib/tools/cython/Cython/Includes/cpython/array.pxd index 19230a0a82..5d37c007df 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/array.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/array.pxd @@ -52,14 +52,14 @@ from libc.string cimport strcat, strncat, \ from cpython.object cimport Py_SIZE from cpython.ref cimport PyTypeObject, Py_TYPE from cpython.exc cimport PyErr_BadArgument -from cpython.mem cimport PyObject_Malloc, PyObject_Free +from cpython.mem cimport PyObject_Malloc, PyObject_Free cdef extern from *: # Hard-coded utility code hack. ctypedef class array.array [object arrayobject] ctypedef object GETF(array a, Py_ssize_t ix) ctypedef object SETF(array a, Py_ssize_t ix, object o) ctypedef struct arraydescr: # [object arraydescr]: - char typecode + char typecode int itemsize GETF getitem # PyObject * (*getitem)(struct arrayobject *, Py_ssize_t); SETF setitem # int (*setitem)(struct arrayobject *, Py_ssize_t, PyObject *); @@ -104,7 +104,7 @@ cdef extern from *: # Hard-coded utility code hack. info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) info.len = info.itemsize * item_count - info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) + info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) if not info.shape: raise MemoryError() info.shape[0] = item_count # constant regardless of resizing @@ -116,7 +116,7 @@ cdef extern from *: # Hard-coded utility code hack. info.obj = self def __releasebuffer__(self, Py_buffer* info): - PyObject_Free(info.shape) + PyObject_Free(info.shape) array newarrayobject(PyTypeObject* type, Py_ssize_t size, arraydescr *descr) diff --git a/contrib/tools/cython/Cython/Includes/cpython/buffer.pxd b/contrib/tools/cython/Cython/Includes/cpython/buffer.pxd index 3f1ada774a..2f6158f1f1 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/buffer.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/buffer.pxd @@ -8,7 +8,7 @@ cdef extern from "Python.h": cdef enum: PyBUF_SIMPLE, PyBUF_WRITABLE, - PyBUF_WRITEABLE, # backwards compatibility + PyBUF_WRITEABLE, # backwards compatibility PyBUF_FORMAT, PyBUF_ND, PyBUF_STRIDES, diff --git a/contrib/tools/cython/Cython/Includes/cpython/bytearray.pxd b/contrib/tools/cython/Cython/Includes/cpython/bytearray.pxd index 1af4a6c427..4da41c4a0a 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/bytearray.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/bytearray.pxd @@ -1,33 +1,33 @@ -from .object cimport PyObject - -cdef extern from "Python.h": - bint PyByteArray_Check(object o) - # Return true if the object o is a bytearray object or an instance of a subtype of the bytearray type. - - bint PyByteArray_CheckExact(object o) - # Return true if the object o is a bytearray object, but not an instance of a subtype of the bytearray type. - - bytearray PyByteArray_FromObject(object o) - # Return a new bytearray object from any object, o, that implements the buffer protocol. - - bytearray PyByteArray_FromStringAndSize(char *string, Py_ssize_t len) - # Create a new bytearray object from string and its length, len. On failure, NULL is returned. - - bytearray PyByteArray_Concat(object a, object b) - # Concat bytearrays a and b and return a new bytearray with the result. - - Py_ssize_t PyByteArray_Size(object bytearray) - # Return the size of bytearray after checking for a NULL pointer. - - char* PyByteArray_AsString(object bytearray) - # Return the contents of bytearray as a char array after checking for a NULL pointer. - # The returned array always has an extra null byte appended. - - int PyByteArray_Resize(object bytearray, Py_ssize_t len) - # Resize the internal buffer of bytearray to len. - - char* PyByteArray_AS_STRING(object bytearray) - # Macro version of PyByteArray_AsString(). - - Py_ssize_t PyByteArray_GET_SIZE(object bytearray) - # Macro version of PyByteArray_Size(). +from .object cimport PyObject + +cdef extern from "Python.h": + bint PyByteArray_Check(object o) + # Return true if the object o is a bytearray object or an instance of a subtype of the bytearray type. + + bint PyByteArray_CheckExact(object o) + # Return true if the object o is a bytearray object, but not an instance of a subtype of the bytearray type. + + bytearray PyByteArray_FromObject(object o) + # Return a new bytearray object from any object, o, that implements the buffer protocol. + + bytearray PyByteArray_FromStringAndSize(char *string, Py_ssize_t len) + # Create a new bytearray object from string and its length, len. On failure, NULL is returned. + + bytearray PyByteArray_Concat(object a, object b) + # Concat bytearrays a and b and return a new bytearray with the result. + + Py_ssize_t PyByteArray_Size(object bytearray) + # Return the size of bytearray after checking for a NULL pointer. + + char* PyByteArray_AsString(object bytearray) + # Return the contents of bytearray as a char array after checking for a NULL pointer. + # The returned array always has an extra null byte appended. + + int PyByteArray_Resize(object bytearray, Py_ssize_t len) + # Resize the internal buffer of bytearray to len. + + char* PyByteArray_AS_STRING(object bytearray) + # Macro version of PyByteArray_AsString(). + + Py_ssize_t PyByteArray_GET_SIZE(object bytearray) + # Macro version of PyByteArray_Size(). diff --git a/contrib/tools/cython/Cython/Includes/cpython/bytes.pxd b/contrib/tools/cython/Cython/Includes/cpython/bytes.pxd index ea72c6aae7..a21cc3baf6 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/bytes.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/bytes.pxd @@ -1,4 +1,4 @@ -from .object cimport PyObject +from .object cimport PyObject cdef extern from "Python.h": ctypedef struct va_list diff --git a/contrib/tools/cython/Cython/Includes/cpython/ceval.pxd b/contrib/tools/cython/Cython/Includes/cpython/ceval.pxd index f22191f9fe..51631b0a26 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/ceval.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/ceval.pxd @@ -1,8 +1,8 @@ - -cdef extern from "Python.h": - - void PyEval_InitThreads() - # Initialize and acquire the global interpreter lock. - - int PyEval_ThreadsInitialized() - # Returns a non-zero value if PyEval_InitThreads() has been called. + +cdef extern from "Python.h": + + void PyEval_InitThreads() + # Initialize and acquire the global interpreter lock. + + int PyEval_ThreadsInitialized() + # Returns a non-zero value if PyEval_InitThreads() has been called. diff --git a/contrib/tools/cython/Cython/Includes/cpython/datetime.pxd b/contrib/tools/cython/Cython/Includes/cpython/datetime.pxd index cd0f90719b..4dbf40d677 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/datetime.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/datetime.pxd @@ -1,4 +1,4 @@ -from cpython.object cimport PyObject +from cpython.object cimport PyObject cdef extern from "Python.h": ctypedef struct PyTypeObject: diff --git a/contrib/tools/cython/Cython/Includes/cpython/dict.pxd b/contrib/tools/cython/Cython/Includes/cpython/dict.pxd index 16dd5e1458..fc531ab7af 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/dict.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/dict.pxd @@ -1,4 +1,4 @@ -from .object cimport PyObject +from .object cimport PyObject cdef extern from "Python.h": @@ -52,7 +52,7 @@ cdef extern from "Python.h": # be hashable; if it isn't, TypeError will be raised. Return 0 on # success or -1 on failure. - int PyDict_SetItemString(object p, const char *key, object val) except -1 + int PyDict_SetItemString(object p, const char *key, object val) except -1 # Insert value into the dictionary p using key as a key. key # should be a char*. The key object is created using # PyString_FromString(key). Return 0 on success or -1 on failure. @@ -62,7 +62,7 @@ cdef extern from "Python.h": # hashable; if it isn't, TypeError is raised. Return 0 on success # or -1 on failure. - int PyDict_DelItemString(object p, const char *key) except -1 + int PyDict_DelItemString(object p, const char *key) except -1 # Remove the entry in dictionary p which has a key specified by # the string key. Return 0 on success or -1 on failure. @@ -72,7 +72,7 @@ cdef extern from "Python.h": # NULL if the key key is not present, but without setting an # exception. - PyObject* PyDict_GetItemString(object p, const char *key) + PyObject* PyDict_GetItemString(object p, const char *key) # Return value: Borrowed reference. # This is the same as PyDict_GetItem(), but key is specified as a # char*, rather than a PyObject*. diff --git a/contrib/tools/cython/Cython/Includes/cpython/exc.pxd b/contrib/tools/cython/Cython/Includes/cpython/exc.pxd index bc57c0e571..608fe3e560 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/exc.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/exc.pxd @@ -1,4 +1,4 @@ -from .object cimport PyObject +from .object cimport PyObject cdef extern from "Python.h": @@ -50,7 +50,7 @@ cdef extern from "Python.h": # return value to a specific exception; use # PyErr_ExceptionMatches() instead, shown below. (The comparison # could easily fail since the exception may be an instance instead - # of a class, in the case of a class exception, or it may be a + # of a class, in the case of a class exception, or it may be a # subclass of the expected exception.) bint PyErr_ExceptionMatches(object exc) @@ -153,13 +153,13 @@ cdef extern from "Python.h": # PyErr_SetFromErrno(type);" when the system call returns an # error. - PyObject* PyErr_SetFromErrnoWithFilenameObject(object type, object filenameObject) except NULL - # Similar to PyErr_SetFromErrno(), with the additional behavior - # that if filenameObject is not NULL, it is passed to the - # constructor of type as a third parameter. - # In the case of OSError exception, this is used to define - # the filename attribute of the exception instance. - + PyObject* PyErr_SetFromErrnoWithFilenameObject(object type, object filenameObject) except NULL + # Similar to PyErr_SetFromErrno(), with the additional behavior + # that if filenameObject is not NULL, it is passed to the + # constructor of type as a third parameter. + # In the case of OSError exception, this is used to define + # the filename attribute of the exception instance. + PyObject* PyErr_SetFromErrnoWithFilename(object type, char *filename) except NULL # Return value: Always NULL. Similar to PyErr_SetFromErrno(), # with the additional behavior that if filename is not NULL, it is diff --git a/contrib/tools/cython/Cython/Includes/cpython/function.pxd b/contrib/tools/cython/Cython/Includes/cpython/function.pxd index 0002a3f6cb..8818e1e560 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/function.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/function.pxd @@ -1,4 +1,4 @@ -from .object cimport PyObject +from .object cimport PyObject cdef extern from "Python.h": diff --git a/contrib/tools/cython/Cython/Includes/cpython/int.pxd b/contrib/tools/cython/Cython/Includes/cpython/int.pxd index 50babff615..e70cb3698f 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/int.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/int.pxd @@ -46,12 +46,12 @@ cdef extern from "Python.h": object PyInt_FromSsize_t(Py_ssize_t ival) # Return value: New reference. # Create a new integer object with a value of ival. If the value - # is larger than LONG_MAX or smaller than LONG_MIN, a long integer - # object is returned. - - object PyInt_FromSize_t(size_t ival) - # Return value: New reference. - # Create a new integer object with a value of ival. If the value + # is larger than LONG_MAX or smaller than LONG_MIN, a long integer + # object is returned. + + object PyInt_FromSize_t(size_t ival) + # Return value: New reference. + # Create a new integer object with a value of ival. If the value # exceeds LONG_MAX, a long integer object is returned. long PyInt_AsLong(object io) except? -1 @@ -83,7 +83,7 @@ cdef extern from "Python.h": long PyInt_GetMax() # Return the system's idea of the largest integer it can handle # (LONG_MAX, as defined in the system header files). - - int PyInt_ClearFreeList() - # Clear the integer free list. Return the number of items that could not be freed. - # New in version 2.6. + + int PyInt_ClearFreeList() + # Clear the integer free list. Return the number of items that could not be freed. + # New in version 2.6. diff --git a/contrib/tools/cython/Cython/Includes/cpython/list.pxd b/contrib/tools/cython/Cython/Includes/cpython/list.pxd index c6a29535c9..0d3d2c95a7 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/list.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/list.pxd @@ -1,4 +1,4 @@ -from .object cimport PyObject +from .object cimport PyObject cdef extern from "Python.h": diff --git a/contrib/tools/cython/Cython/Includes/cpython/long.pxd b/contrib/tools/cython/Cython/Includes/cpython/long.pxd index eb8140d417..2b70f9bbb1 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/long.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/long.pxd @@ -146,4 +146,4 @@ cdef extern from "Python.h": # pointer. If pylong cannot be converted, an OverflowError will be # raised. This is only assured to produce a usable void pointer # for values created with PyLong_FromVoidPtr(). For values outside - # 0..LONG_MAX, both signed and unsigned integers are accepted. + # 0..LONG_MAX, both signed and unsigned integers are accepted. diff --git a/contrib/tools/cython/Cython/Includes/cpython/longintrepr.pxd b/contrib/tools/cython/Cython/Includes/cpython/longintrepr.pxd index c38c1bff88..12fb7dc0f5 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/longintrepr.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/longintrepr.pxd @@ -1,19 +1,19 @@ -# Internals of the "long" type (Python 2) or "int" type (Python 3). - +# Internals of the "long" type (Python 2) or "int" type (Python 3). + cdef extern from "Python.h": """ #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif """ - ctypedef unsigned int digit - ctypedef int sdigit # Python >= 2.7 only - - ctypedef class __builtin__.py_long [object PyLongObject]: - cdef digit* ob_digit - - cdef py_long _PyLong_New(Py_ssize_t s) - - cdef long PyLong_SHIFT - cdef digit PyLong_BASE - cdef digit PyLong_MASK + ctypedef unsigned int digit + ctypedef int sdigit # Python >= 2.7 only + + ctypedef class __builtin__.py_long [object PyLongObject]: + cdef digit* ob_digit + + cdef py_long _PyLong_New(Py_ssize_t s) + + cdef long PyLong_SHIFT + cdef digit PyLong_BASE + cdef digit PyLong_MASK diff --git a/contrib/tools/cython/Cython/Includes/cpython/mem.pxd b/contrib/tools/cython/Cython/Includes/cpython/mem.pxd index af820f2ee0..57b12c9224 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/mem.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/mem.pxd @@ -27,7 +27,7 @@ cdef extern from "Python.h": # available for allocating and releasing memory from the Python # heap: - void* PyMem_RawMalloc(size_t n) nogil + void* PyMem_RawMalloc(size_t n) nogil void* PyMem_Malloc(size_t n) # Allocates n bytes and returns a pointer of type void* to the # allocated memory, or NULL if the request fails. Requesting zero @@ -35,7 +35,7 @@ cdef extern from "Python.h": # PyMem_Malloc(1) had been called instead. The memory will not # have been initialized in any way. - void* PyMem_RawRealloc(void *p, size_t n) nogil + void* PyMem_RawRealloc(void *p, size_t n) nogil void* PyMem_Realloc(void *p, size_t n) # Resizes the memory block pointed to by p to n bytes. The # contents will be unchanged to the minimum of the old and the new @@ -45,7 +45,7 @@ cdef extern from "Python.h": # NULL, it must have been returned by a previous call to # PyMem_Malloc() or PyMem_Realloc(). - void PyMem_RawFree(void *p) nogil + void PyMem_RawFree(void *p) nogil void PyMem_Free(void *p) # Frees the memory block pointed to by p, which must have been # returned by a previous call to PyMem_Malloc() or @@ -76,36 +76,36 @@ cdef extern from "Python.h": # PyMem_MALLOC(), PyMem_REALLOC(), PyMem_FREE(). # PyMem_NEW(), PyMem_RESIZE(), PyMem_DEL(). - - - ##################################################################### - # Raw object memory interface - ##################################################################### - - # Functions to call the same malloc/realloc/free as used by Python's - # object allocator. If WITH_PYMALLOC is enabled, these may differ from - # the platform malloc/realloc/free. The Python object allocator is - # designed for fast, cache-conscious allocation of many "small" objects, - # and with low hidden memory overhead. - # - # PyObject_Malloc(0) returns a unique non-NULL pointer if possible. - # - # PyObject_Realloc(NULL, n) acts like PyObject_Malloc(n). - # PyObject_Realloc(p != NULL, 0) does not return NULL, or free the memory - # at p. - # - # Returned pointers must be checked for NULL explicitly; no action is - # performed on failure other than to return NULL (no warning it printed, no - # exception is set, etc). - # - # For allocating objects, use PyObject_{New, NewVar} instead whenever - # possible. The PyObject_{Malloc, Realloc, Free} family is exposed - # so that you can exploit Python's small-block allocator for non-object - # uses. If you must use these routines to allocate object memory, make sure - # the object gets initialized via PyObject_{Init, InitVar} after obtaining - # the raw memory. - - void* PyObject_Malloc(size_t size) - void* PyObject_Calloc(size_t nelem, size_t elsize) - void* PyObject_Realloc(void *ptr, size_t new_size) - void PyObject_Free(void *ptr) + + + ##################################################################### + # Raw object memory interface + ##################################################################### + + # Functions to call the same malloc/realloc/free as used by Python's + # object allocator. If WITH_PYMALLOC is enabled, these may differ from + # the platform malloc/realloc/free. The Python object allocator is + # designed for fast, cache-conscious allocation of many "small" objects, + # and with low hidden memory overhead. + # + # PyObject_Malloc(0) returns a unique non-NULL pointer if possible. + # + # PyObject_Realloc(NULL, n) acts like PyObject_Malloc(n). + # PyObject_Realloc(p != NULL, 0) does not return NULL, or free the memory + # at p. + # + # Returned pointers must be checked for NULL explicitly; no action is + # performed on failure other than to return NULL (no warning it printed, no + # exception is set, etc). + # + # For allocating objects, use PyObject_{New, NewVar} instead whenever + # possible. The PyObject_{Malloc, Realloc, Free} family is exposed + # so that you can exploit Python's small-block allocator for non-object + # uses. If you must use these routines to allocate object memory, make sure + # the object gets initialized via PyObject_{Init, InitVar} after obtaining + # the raw memory. + + void* PyObject_Malloc(size_t size) + void* PyObject_Calloc(size_t nelem, size_t elsize) + void* PyObject_Realloc(void *ptr, size_t new_size) + void PyObject_Free(void *ptr) diff --git a/contrib/tools/cython/Cython/Includes/cpython/method.pxd b/contrib/tools/cython/Cython/Includes/cpython/method.pxd index f51ebcc7c7..7866562605 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/method.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/method.pxd @@ -1,5 +1,5 @@ -from .object cimport PyObject - +from .object cimport PyObject + cdef extern from "Python.h": ############################################################################ # 7.5.4 Method Objects diff --git a/contrib/tools/cython/Cython/Includes/cpython/module.pxd b/contrib/tools/cython/Cython/Includes/cpython/module.pxd index 8eb323b010..d804eea5d1 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/module.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/module.pxd @@ -1,4 +1,4 @@ -from .object cimport PyObject +from .object cimport PyObject cdef extern from "Python.h": ctypedef struct _inittab @@ -6,7 +6,7 @@ cdef extern from "Python.h": ##################################################################### # 5.3 Importing Modules ##################################################################### - object PyImport_ImportModule(const char *name) + object PyImport_ImportModule(const char *name) # Return value: New reference. # This is a simplified interface to PyImport_ImportModuleEx() # below, leaving the globals and locals arguments set to @@ -20,7 +20,7 @@ cdef extern from "Python.h": # loaded.) Return a new reference to the imported module, or NULL # with an exception set on failure. - object PyImport_ImportModuleEx(const char *name, object globals, object locals, object fromlist) + object PyImport_ImportModuleEx(const char *name, object globals, object locals, object fromlist) # Return value: New reference. # Import a module. This is best described by referring to the @@ -64,7 +64,7 @@ cdef extern from "Python.h": # the reloaded module, or NULL with an exception set on failure # (the module still exists in this case). - PyObject* PyImport_AddModule(const char *name) except NULL + PyObject* PyImport_AddModule(const char *name) except NULL # Return value: Borrowed reference. # Return the module object corresponding to a module name. The # name argument may be of the form package.module. First check the @@ -145,7 +145,7 @@ cdef extern from "Python.h": bint PyModule_CheckExact(object p) # Return true if p is a module object, but not a subtype of PyModule_Type. - object PyModule_New(const char *name) + object PyModule_New(const char *name) # Return value: New reference. # Return a new module object with the __name__ attribute set to # name. Only the module's __doc__ and __name__ attributes are @@ -170,18 +170,18 @@ cdef extern from "Python.h": # module's __file__ attribute. If this is not defined, or if it is # not a string, raise SystemError and return NULL. - int PyModule_AddObject(object module, const char *name, object value) except -1 + int PyModule_AddObject(object module, const char *name, object value) except -1 # Add an object to module as name. This is a convenience function # which can be used from the module's initialization # function. This steals a reference to value. Return -1 on error, # 0 on success. - int PyModule_AddIntConstant(object module, const char *name, long value) except -1 + int PyModule_AddIntConstant(object module, const char *name, long value) except -1 # Add an integer constant to module as name. This convenience # function can be used from the module's initialization # function. Return -1 on error, 0 on success. - int PyModule_AddStringConstant(object module, const char *name, const char *value) except -1 + int PyModule_AddStringConstant(object module, const char *name, const char *value) except -1 # Add a string constant to module as name. This convenience # function can be used from the module's initialization # function. The string value must be null-terminated. Return -1 on diff --git a/contrib/tools/cython/Cython/Includes/cpython/number.pxd b/contrib/tools/cython/Cython/Includes/cpython/number.pxd index ded35c292a..4e926fc3c5 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/number.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/number.pxd @@ -1,4 +1,4 @@ -from .object cimport PyObject +from .object cimport PyObject cdef extern from "Python.h": diff --git a/contrib/tools/cython/Cython/Includes/cpython/object.pxd b/contrib/tools/cython/Cython/Includes/cpython/object.pxd index 5a81166393..891efb847f 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/object.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/object.pxd @@ -1,78 +1,78 @@ from libc.stdio cimport FILE -cimport cpython.type +cimport cpython.type cdef extern from "Python.h": - ctypedef struct PyObject # forward declaration - - ctypedef object (*newfunc)(cpython.type.type, object, object) # (type, args, kwargs) - - ctypedef object (*unaryfunc)(object) - ctypedef object (*binaryfunc)(object, object) - ctypedef object (*ternaryfunc)(object, object, object) + ctypedef struct PyObject # forward declaration + + ctypedef object (*newfunc)(cpython.type.type, object, object) # (type, args, kwargs) + + ctypedef object (*unaryfunc)(object) + ctypedef object (*binaryfunc)(object, object) + ctypedef object (*ternaryfunc)(object, object, object) ctypedef int (*inquiry)(object) except -1 ctypedef Py_ssize_t (*lenfunc)(object) except -1 - ctypedef object (*ssizeargfunc)(object, Py_ssize_t) - ctypedef object (*ssizessizeargfunc)(object, Py_ssize_t, Py_ssize_t) + ctypedef object (*ssizeargfunc)(object, Py_ssize_t) + ctypedef object (*ssizessizeargfunc)(object, Py_ssize_t, Py_ssize_t) ctypedef int (*ssizeobjargproc)(object, Py_ssize_t, object) except -1 ctypedef int (*ssizessizeobjargproc)(object, Py_ssize_t, Py_ssize_t, object) except -1 ctypedef int (*objobjargproc)(object, object, object) except -1 ctypedef int (*objobjproc)(object, object) except -1 - + ctypedef Py_hash_t (*hashfunc)(object) except -1 - ctypedef object (*reprfunc)(object) - + ctypedef object (*reprfunc)(object) + ctypedef int (*cmpfunc)(object, object) except -2 - ctypedef object (*richcmpfunc)(object, object, int) - - # The following functions use 'PyObject*' as first argument instead of 'object' to prevent - # accidental reference counting when calling them during a garbage collection run. - ctypedef void (*destructor)(PyObject*) + ctypedef object (*richcmpfunc)(object, object, int) + + # The following functions use 'PyObject*' as first argument instead of 'object' to prevent + # accidental reference counting when calling them during a garbage collection run. + ctypedef void (*destructor)(PyObject*) ctypedef int (*visitproc)(PyObject*, void *) except -1 ctypedef int (*traverseproc)(PyObject*, visitproc, void*) except -1 ctypedef void (*freefunc)(void*) - - ctypedef object (*descrgetfunc)(object, object, object) - ctypedef int (*descrsetfunc)(object, object, object) except -1 - - ctypedef struct PyTypeObject: - const char* tp_name - const char* tp_doc - Py_ssize_t tp_basicsize - Py_ssize_t tp_itemsize - Py_ssize_t tp_dictoffset - unsigned long tp_flags - - newfunc tp_new - destructor tp_dealloc - traverseproc tp_traverse - inquiry tp_clear + + ctypedef object (*descrgetfunc)(object, object, object) + ctypedef int (*descrsetfunc)(object, object, object) except -1 + + ctypedef struct PyTypeObject: + const char* tp_name + const char* tp_doc + Py_ssize_t tp_basicsize + Py_ssize_t tp_itemsize + Py_ssize_t tp_dictoffset + unsigned long tp_flags + + newfunc tp_new + destructor tp_dealloc + traverseproc tp_traverse + inquiry tp_clear freefunc tp_free - - ternaryfunc tp_call - hashfunc tp_hash - reprfunc tp_str - reprfunc tp_repr - - cmpfunc tp_compare - richcmpfunc tp_richcompare - - PyTypeObject* tp_base - PyObject* tp_dict - - descrgetfunc tp_descr_get - descrsetfunc tp_descr_set - - ctypedef struct PyObject: - Py_ssize_t ob_refcnt - PyTypeObject *ob_type - - cdef PyTypeObject *Py_TYPE(object) - - void* PyObject_Malloc(size_t) - void* PyObject_Realloc(void *, size_t) - void PyObject_Free(void *) - + + ternaryfunc tp_call + hashfunc tp_hash + reprfunc tp_str + reprfunc tp_repr + + cmpfunc tp_compare + richcmpfunc tp_richcompare + + PyTypeObject* tp_base + PyObject* tp_dict + + descrgetfunc tp_descr_get + descrsetfunc tp_descr_set + + ctypedef struct PyObject: + Py_ssize_t ob_refcnt + PyTypeObject *ob_type + + cdef PyTypeObject *Py_TYPE(object) + + void* PyObject_Malloc(size_t) + void* PyObject_Realloc(void *, size_t) + void PyObject_Free(void *) + ##################################################################### # 6.1 Object Protocol ##################################################################### @@ -82,12 +82,12 @@ cdef extern from "Python.h": # option currently supported is Py_PRINT_RAW; if given, the str() # of the object is written instead of the repr(). - bint PyObject_HasAttrString(object o, const char *attr_name) + bint PyObject_HasAttrString(object o, const char *attr_name) # Returns 1 if o has the attribute attr_name, and 0 # otherwise. This is equivalent to the Python expression # "hasattr(o, attr_name)". This function always succeeds. - object PyObject_GetAttrString(object o, const char *attr_name) + object PyObject_GetAttrString(object o, const char *attr_name) # Return value: New reference. Retrieve an attribute named # attr_name from object o. Returns the attribute value on success, # or NULL on failure. This is the equivalent of the Python @@ -106,7 +106,7 @@ cdef extern from "Python.h": object PyObject_GenericGetAttr(object o, object attr_name) - int PyObject_SetAttrString(object o, const char *attr_name, object v) except -1 + int PyObject_SetAttrString(object o, const char *attr_name, object v) except -1 # Set the value of the attribute named attr_name, for object o, to # the value v. Returns -1 on failure. This is the equivalent of # the Python statement "o.attr_name = v". @@ -118,7 +118,7 @@ cdef extern from "Python.h": int PyObject_GenericSetAttr(object o, object attr_name, object v) except -1 - int PyObject_DelAttrString(object o, const char *attr_name) except -1 + int PyObject_DelAttrString(object o, const char *attr_name) except -1 # Delete attribute named attr_name, for object o. Returns -1 on # failure. This is the equivalent of the Python statement: "del # o.attr_name". @@ -364,36 +364,36 @@ cdef extern from "Python.h": # Takes an arbitrary object and returns the result of calling # obj.__format__(format_spec). # Added in Py2.6 - - # Type flags (tp_flags of PyTypeObject) - long Py_TPFLAGS_HAVE_GETCHARBUFFER - long Py_TPFLAGS_HAVE_SEQUENCE_IN - long Py_TPFLAGS_HAVE_INPLACEOPS - long Py_TPFLAGS_CHECKTYPES - long Py_TPFLAGS_HAVE_RICHCOMPARE - long Py_TPFLAGS_HAVE_WEAKREFS - long Py_TPFLAGS_HAVE_ITER - long Py_TPFLAGS_HAVE_CLASS - long Py_TPFLAGS_HEAPTYPE - long Py_TPFLAGS_BASETYPE - long Py_TPFLAGS_READY - long Py_TPFLAGS_READYING - long Py_TPFLAGS_HAVE_GC - long Py_TPFLAGS_HAVE_STACKLESS_EXTENSION - long Py_TPFLAGS_HAVE_INDEX - long Py_TPFLAGS_HAVE_VERSION_TAG - long Py_TPFLAGS_VALID_VERSION_TAG - long Py_TPFLAGS_IS_ABSTRACT - long Py_TPFLAGS_HAVE_NEWBUFFER - long Py_TPFLAGS_INT_SUBCLASS - long Py_TPFLAGS_LONG_SUBCLASS - long Py_TPFLAGS_LIST_SUBCLASS - long Py_TPFLAGS_TUPLE_SUBCLASS - long Py_TPFLAGS_STRING_SUBCLASS - long Py_TPFLAGS_UNICODE_SUBCLASS - long Py_TPFLAGS_DICT_SUBCLASS - long Py_TPFLAGS_BASE_EXC_SUBCLASS - long Py_TPFLAGS_TYPE_SUBCLASS - long Py_TPFLAGS_DEFAULT_EXTERNAL - long Py_TPFLAGS_DEFAULT_CORE - long Py_TPFLAGS_DEFAULT + + # Type flags (tp_flags of PyTypeObject) + long Py_TPFLAGS_HAVE_GETCHARBUFFER + long Py_TPFLAGS_HAVE_SEQUENCE_IN + long Py_TPFLAGS_HAVE_INPLACEOPS + long Py_TPFLAGS_CHECKTYPES + long Py_TPFLAGS_HAVE_RICHCOMPARE + long Py_TPFLAGS_HAVE_WEAKREFS + long Py_TPFLAGS_HAVE_ITER + long Py_TPFLAGS_HAVE_CLASS + long Py_TPFLAGS_HEAPTYPE + long Py_TPFLAGS_BASETYPE + long Py_TPFLAGS_READY + long Py_TPFLAGS_READYING + long Py_TPFLAGS_HAVE_GC + long Py_TPFLAGS_HAVE_STACKLESS_EXTENSION + long Py_TPFLAGS_HAVE_INDEX + long Py_TPFLAGS_HAVE_VERSION_TAG + long Py_TPFLAGS_VALID_VERSION_TAG + long Py_TPFLAGS_IS_ABSTRACT + long Py_TPFLAGS_HAVE_NEWBUFFER + long Py_TPFLAGS_INT_SUBCLASS + long Py_TPFLAGS_LONG_SUBCLASS + long Py_TPFLAGS_LIST_SUBCLASS + long Py_TPFLAGS_TUPLE_SUBCLASS + long Py_TPFLAGS_STRING_SUBCLASS + long Py_TPFLAGS_UNICODE_SUBCLASS + long Py_TPFLAGS_DICT_SUBCLASS + long Py_TPFLAGS_BASE_EXC_SUBCLASS + long Py_TPFLAGS_TYPE_SUBCLASS + long Py_TPFLAGS_DEFAULT_EXTERNAL + long Py_TPFLAGS_DEFAULT_CORE + long Py_TPFLAGS_DEFAULT diff --git a/contrib/tools/cython/Cython/Includes/cpython/pylifecycle.pxd b/contrib/tools/cython/Cython/Includes/cpython/pylifecycle.pxd index 2c71e37163..07f4edd397 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/pylifecycle.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/pylifecycle.pxd @@ -1,68 +1,68 @@ -# Interfaces to configure, query, create & destroy the Python runtime - -from libc.stdio cimport FILE -from .pystate cimport PyThreadState - - -cdef extern from "Python.h": - ctypedef int wchar_t - - void Py_SetProgramName(wchar_t *) - wchar_t *Py_GetProgramName() - - void Py_SetPythonHome(wchar_t *) - wchar_t *Py_GetPythonHome() - - # Only used by applications that embed the interpreter and need to - # override the standard encoding determination mechanism - int Py_SetStandardStreamEncoding(const char *encoding, const char *errors) - - void Py_Initialize() - void Py_InitializeEx(int) - void _Py_InitializeEx_Private(int, int) - void Py_Finalize() - int Py_FinalizeEx() - int Py_IsInitialized() - PyThreadState *Py_NewInterpreter() - void Py_EndInterpreter(PyThreadState *) - - +# Interfaces to configure, query, create & destroy the Python runtime + +from libc.stdio cimport FILE +from .pystate cimport PyThreadState + + +cdef extern from "Python.h": + ctypedef int wchar_t + + void Py_SetProgramName(wchar_t *) + wchar_t *Py_GetProgramName() + + void Py_SetPythonHome(wchar_t *) + wchar_t *Py_GetPythonHome() + + # Only used by applications that embed the interpreter and need to + # override the standard encoding determination mechanism + int Py_SetStandardStreamEncoding(const char *encoding, const char *errors) + + void Py_Initialize() + void Py_InitializeEx(int) + void _Py_InitializeEx_Private(int, int) + void Py_Finalize() + int Py_FinalizeEx() + int Py_IsInitialized() + PyThreadState *Py_NewInterpreter() + void Py_EndInterpreter(PyThreadState *) + + # _Py_PyAtExit is for the atexit module, Py_AtExit is for low-level - # exit functions. + # exit functions. void _Py_PyAtExit(void (*func)(object), object) - int Py_AtExit(void (*func)()) - - void Py_Exit(int) - - # Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. - void _Py_RestoreSignals() - - int Py_FdIsInteractive(FILE *, const char *) - - # Bootstrap __main__ (defined in Modules/main.c) - int Py_Main(int argc, wchar_t **argv) - - # In getpath.c - wchar_t *Py_GetProgramFullPath() - wchar_t *Py_GetPrefix() - wchar_t *Py_GetExecPrefix() - wchar_t *Py_GetPath() - void Py_SetPath(const wchar_t *) - int _Py_CheckPython3() - - # In their own files - const char *Py_GetVersion() - const char *Py_GetPlatform() - const char *Py_GetCopyright() - const char *Py_GetCompiler() - const char *Py_GetBuildInfo() - const char *_Py_gitidentifier() - const char *_Py_gitversion() - - ctypedef void (*PyOS_sighandler_t)(int) - PyOS_sighandler_t PyOS_getsig(int) - PyOS_sighandler_t PyOS_setsig(int, PyOS_sighandler_t) - - # Random - int _PyOS_URandom(void *buffer, Py_ssize_t size) - int _PyOS_URandomNonblock(void *buffer, Py_ssize_t size) + int Py_AtExit(void (*func)()) + + void Py_Exit(int) + + # Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. + void _Py_RestoreSignals() + + int Py_FdIsInteractive(FILE *, const char *) + + # Bootstrap __main__ (defined in Modules/main.c) + int Py_Main(int argc, wchar_t **argv) + + # In getpath.c + wchar_t *Py_GetProgramFullPath() + wchar_t *Py_GetPrefix() + wchar_t *Py_GetExecPrefix() + wchar_t *Py_GetPath() + void Py_SetPath(const wchar_t *) + int _Py_CheckPython3() + + # In their own files + const char *Py_GetVersion() + const char *Py_GetPlatform() + const char *Py_GetCopyright() + const char *Py_GetCompiler() + const char *Py_GetBuildInfo() + const char *_Py_gitidentifier() + const char *_Py_gitversion() + + ctypedef void (*PyOS_sighandler_t)(int) + PyOS_sighandler_t PyOS_getsig(int) + PyOS_sighandler_t PyOS_setsig(int, PyOS_sighandler_t) + + # Random + int _PyOS_URandom(void *buffer, Py_ssize_t size) + int _PyOS_URandomNonblock(void *buffer, Py_ssize_t size) diff --git a/contrib/tools/cython/Cython/Includes/cpython/pystate.pxd b/contrib/tools/cython/Cython/Includes/cpython/pystate.pxd index 1af6307931..07dcfda048 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/pystate.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/pystate.pxd @@ -1,14 +1,14 @@ # Thread and interpreter state structures and their interfaces -from .object cimport PyObject +from .object cimport PyObject cdef extern from "Python.h": - # We make these an opaque types. If the user wants specific attributes, + # We make these an opaque types. If the user wants specific attributes, # they can be declared manually. - ctypedef long PY_INT64_T # FIXME: Py2.7+, not defined here but used here - + ctypedef long PY_INT64_T # FIXME: Py2.7+, not defined here but used here + ctypedef struct PyInterpreterState: pass @@ -20,8 +20,8 @@ cdef extern from "Python.h": # This is not actually a struct, but make sure it can never be coerced to # an int or used in arithmetic expressions - ctypedef struct PyGILState_STATE: - pass + ctypedef struct PyGILState_STATE: + pass # The type of the trace function registered using PyEval_SetProfile() and # PyEval_SetTrace(). @@ -42,14 +42,14 @@ cdef extern from "Python.h": PyInterpreterState * PyInterpreterState_New() void PyInterpreterState_Clear(PyInterpreterState *) void PyInterpreterState_Delete(PyInterpreterState *) - PY_INT64_T PyInterpreterState_GetID(PyInterpreterState *) + PY_INT64_T PyInterpreterState_GetID(PyInterpreterState *) PyThreadState * PyThreadState_New(PyInterpreterState *) void PyThreadState_Clear(PyThreadState *) void PyThreadState_Delete(PyThreadState *) PyThreadState * PyThreadState_Get() - PyThreadState * PyThreadState_Swap(PyThreadState *) # NOTE: DO NOT USE IN CYTHON CODE ! + PyThreadState * PyThreadState_Swap(PyThreadState *) # NOTE: DO NOT USE IN CYTHON CODE ! PyObject * PyThreadState_GetDict() int PyThreadState_SetAsyncExc(long, PyObject *) diff --git a/contrib/tools/cython/Cython/Includes/cpython/ref.pxd b/contrib/tools/cython/Cython/Includes/cpython/ref.pxd index 4bc9a7d7c8..e586ad5b2b 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/ref.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/ref.pxd @@ -1,5 +1,5 @@ -from .object cimport PyObject, PyTypeObject, Py_TYPE # legacy imports for re-export - +from .object cimport PyObject, PyTypeObject, Py_TYPE # legacy imports for re-export + cdef extern from "Python.h": ##################################################################### # 3. Reference Counts diff --git a/contrib/tools/cython/Cython/Includes/cpython/sequence.pxd b/contrib/tools/cython/Cython/Includes/cpython/sequence.pxd index eb279968d2..4550d1711b 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/sequence.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/sequence.pxd @@ -1,4 +1,4 @@ -from .object cimport PyObject +from .object cimport PyObject cdef extern from "Python.h": diff --git a/contrib/tools/cython/Cython/Includes/cpython/slice.pxd b/contrib/tools/cython/Cython/Includes/cpython/slice.pxd index 202dea716c..a4b26f0c81 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/slice.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/slice.pxd @@ -1,50 +1,50 @@ -cdef extern from "Python.h": - - # PyTypeObject PySlice_Type - # - # The type object for slice objects. This is the same as slice and types.SliceType - - bint PySlice_Check(object ob) - # - # Return true if ob is a slice object; ob must not be NULL. - - slice PySlice_New(object start, object stop, object step) - # - # Return a new slice object with the given values. The start, stop, and step - # parameters are used as the values of the slice object attributes of the same - # names. Any of the values may be NULL, in which case the None will be used - # for the corresponding attribute. Return NULL if the new object could not be - # allocated. - - int PySlice_GetIndices(object slice, Py_ssize_t length, - Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step) except? -1 - # - # Retrieve the start, stop and step indices from the slice object slice, - # assuming a sequence of length length. Treats indices greater than length - # as errors. - # - # Returns 0 on success and -1 on error with no exception set (unless one - # of the indices was not None and failed to be converted to an integer, - # in which case -1 is returned with an exception set). - # - # You probably do not want to use this function. - # - # Changed in version 3.2: The parameter type for the slice parameter was - # PySliceObject* before. - - int PySlice_GetIndicesEx(object slice, Py_ssize_t length, - Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, - Py_ssize_t *slicelength) except -1 - # - # Usable replacement for PySlice_GetIndices(). Retrieve the start, stop, and step - # indices from the slice object slice assuming a sequence of length length, and - # store the length of the slice in slicelength. Out of bounds indices are clipped - # in a manner consistent with the handling of normal slices. - # - # Returns 0 on success and -1 on error with exception set. - # - # Changed in version 3.2: The parameter type for the slice parameter was - # PySliceObject* before. +cdef extern from "Python.h": + + # PyTypeObject PySlice_Type + # + # The type object for slice objects. This is the same as slice and types.SliceType + + bint PySlice_Check(object ob) + # + # Return true if ob is a slice object; ob must not be NULL. + + slice PySlice_New(object start, object stop, object step) + # + # Return a new slice object with the given values. The start, stop, and step + # parameters are used as the values of the slice object attributes of the same + # names. Any of the values may be NULL, in which case the None will be used + # for the corresponding attribute. Return NULL if the new object could not be + # allocated. + + int PySlice_GetIndices(object slice, Py_ssize_t length, + Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step) except? -1 + # + # Retrieve the start, stop and step indices from the slice object slice, + # assuming a sequence of length length. Treats indices greater than length + # as errors. + # + # Returns 0 on success and -1 on error with no exception set (unless one + # of the indices was not None and failed to be converted to an integer, + # in which case -1 is returned with an exception set). + # + # You probably do not want to use this function. + # + # Changed in version 3.2: The parameter type for the slice parameter was + # PySliceObject* before. + + int PySlice_GetIndicesEx(object slice, Py_ssize_t length, + Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, + Py_ssize_t *slicelength) except -1 + # + # Usable replacement for PySlice_GetIndices(). Retrieve the start, stop, and step + # indices from the slice object slice assuming a sequence of length length, and + # store the length of the slice in slicelength. Out of bounds indices are clipped + # in a manner consistent with the handling of normal slices. + # + # Returns 0 on success and -1 on error with exception set. + # + # Changed in version 3.2: The parameter type for the slice parameter was + # PySliceObject* before. int PySlice_Unpack(object slice, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step) except -1 diff --git a/contrib/tools/cython/Cython/Includes/cpython/string.pxd b/contrib/tools/cython/Cython/Includes/cpython/string.pxd index 8af78f3dde..d0476f0fb2 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/string.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/string.pxd @@ -1,4 +1,4 @@ -from .object cimport PyObject +from .object cimport PyObject cdef extern from "Python.h": ctypedef struct va_list diff --git a/contrib/tools/cython/Cython/Includes/cpython/tuple.pxd b/contrib/tools/cython/Cython/Includes/cpython/tuple.pxd index 09c46e0b4b..7e30fc796c 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/tuple.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/tuple.pxd @@ -1,4 +1,4 @@ -from .object cimport PyObject +from .object cimport PyObject cdef extern from "Python.h": diff --git a/contrib/tools/cython/Cython/Includes/cpython/unicode.pxd b/contrib/tools/cython/Cython/Includes/cpython/unicode.pxd index ad01ed64df..a4b6a39b3c 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/unicode.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/unicode.pxd @@ -36,60 +36,60 @@ cdef extern from *: char* PyUnicode_AS_DATA(object o) # Return 1 or 0 depending on whether ch is a whitespace character. - bint Py_UNICODE_ISSPACE(Py_UCS4 ch) + bint Py_UNICODE_ISSPACE(Py_UCS4 ch) # Return 1 or 0 depending on whether ch is a lowercase character. - bint Py_UNICODE_ISLOWER(Py_UCS4 ch) + bint Py_UNICODE_ISLOWER(Py_UCS4 ch) # Return 1 or 0 depending on whether ch is an uppercase character. - bint Py_UNICODE_ISUPPER(Py_UCS4 ch) + bint Py_UNICODE_ISUPPER(Py_UCS4 ch) # Return 1 or 0 depending on whether ch is a titlecase character. - bint Py_UNICODE_ISTITLE(Py_UCS4 ch) + bint Py_UNICODE_ISTITLE(Py_UCS4 ch) # Return 1 or 0 depending on whether ch is a linebreak character. - bint Py_UNICODE_ISLINEBREAK(Py_UCS4 ch) + bint Py_UNICODE_ISLINEBREAK(Py_UCS4 ch) # Return 1 or 0 depending on whether ch is a decimal character. - bint Py_UNICODE_ISDECIMAL(Py_UCS4 ch) + bint Py_UNICODE_ISDECIMAL(Py_UCS4 ch) # Return 1 or 0 depending on whether ch is a digit character. - bint Py_UNICODE_ISDIGIT(Py_UCS4 ch) + bint Py_UNICODE_ISDIGIT(Py_UCS4 ch) # Return 1 or 0 depending on whether ch is a numeric character. - bint Py_UNICODE_ISNUMERIC(Py_UCS4 ch) + bint Py_UNICODE_ISNUMERIC(Py_UCS4 ch) # Return 1 or 0 depending on whether ch is an alphabetic character. - bint Py_UNICODE_ISALPHA(Py_UCS4 ch) + bint Py_UNICODE_ISALPHA(Py_UCS4 ch) # Return 1 or 0 depending on whether ch is an alphanumeric character. - bint Py_UNICODE_ISALNUM(Py_UCS4 ch) + bint Py_UNICODE_ISALNUM(Py_UCS4 ch) # Return the character ch converted to lower case. - # Used to return a Py_UNICODE value before Py3.3. - Py_UCS4 Py_UNICODE_TOLOWER(Py_UCS4 ch) + # Used to return a Py_UNICODE value before Py3.3. + Py_UCS4 Py_UNICODE_TOLOWER(Py_UCS4 ch) # Return the character ch converted to upper case. - # Used to return a Py_UNICODE value before Py3.3. - Py_UCS4 Py_UNICODE_TOUPPER(Py_UCS4 ch) + # Used to return a Py_UNICODE value before Py3.3. + Py_UCS4 Py_UNICODE_TOUPPER(Py_UCS4 ch) # Return the character ch converted to title case. - # Used to return a Py_UNICODE value before Py3.3. - Py_UCS4 Py_UNICODE_TOTITLE(Py_UCS4 ch) + # Used to return a Py_UNICODE value before Py3.3. + Py_UCS4 Py_UNICODE_TOTITLE(Py_UCS4 ch) # Return the character ch converted to a decimal positive # integer. Return -1 if this is not possible. This macro does not # raise exceptions. - int Py_UNICODE_TODECIMAL(Py_UCS4 ch) + int Py_UNICODE_TODECIMAL(Py_UCS4 ch) # Return the character ch converted to a single digit # integer. Return -1 if this is not possible. This macro does not # raise exceptions. - int Py_UNICODE_TODIGIT(Py_UCS4 ch) + int Py_UNICODE_TODIGIT(Py_UCS4 ch) # Return the character ch converted to a double. Return -1.0 if # this is not possible. This macro does not raise exceptions. - double Py_UNICODE_TONUMERIC(Py_UCS4 ch) + double Py_UNICODE_TONUMERIC(Py_UCS4 ch) # To create Unicode objects and access their basic sequence # properties, use these APIs: @@ -145,131 +145,131 @@ cdef extern from *: #Py_ssize_t PyUnicode_AsWideChar(object o, wchar_t *w, Py_ssize_t size) - -# Unicode Methods - - # Concat two strings giving a new Unicode string. - # Return value: New reference. - unicode PyUnicode_Concat(object left, object right) - - # Split a string giving a list of Unicode strings. If sep is NULL, - # splitting will be done at all whitespace substrings. Otherwise, - # splits occur at the given separator. At most maxsplit splits will - # be done. If negative, no limit is set. Separators are not included - # in the resulting list. - # Return value: New reference. - list PyUnicode_Split(object s, object sep, Py_ssize_t maxsplit) - - # Split a Unicode string at line breaks, returning a list of Unicode - # strings. CRLF is considered to be one line break. If keepend is 0, - # the Line break characters are not included in the resulting strings. - # Return value: New reference. - list PyUnicode_Splitlines(object s, bint keepend) - - # Translate a string by applying a character mapping table to it and - # return the resulting Unicode object. - # - # The mapping table must map Unicode ordinal integers to Unicode ordinal - # integers or None (causing deletion of the character). - # - # Mapping tables need only provide the __getitem__() interface; - # dictionaries and sequences work well. Unmapped character ordinals (ones - # which cause a LookupError) are left untouched and are copied as-is. - # - # errors has the usual meaning for codecs. It may be NULL which indicates - # to use the default error handling. - # Return value: New reference. - unicode PyUnicode_Translate(object str, object table, const char *errors) - - # Join a sequence of strings using the given separator and return the - # resulting Unicode string. - # Return value: New reference. - unicode PyUnicode_Join(object separator, object seq) - - # Return 1 if substr matches str[start:end] at the given tail end - # (direction == -1 means to do a prefix match, direction == 1 a - # suffix match), 0 otherwise. - # Return -1 if an error occurred. - Py_ssize_t PyUnicode_Tailmatch(object str, object substr, - Py_ssize_t start, Py_ssize_t end, int direction) except -1 - - # Return the first position of substr in str[start:end] using the given - # direction (direction == 1 means to do a forward search, direction == -1 - # a backward search). The return value is the index of the first match; - # a value of -1 indicates that no match was found, and -2 indicates that an - # error occurred and an exception has been set. - Py_ssize_t PyUnicode_Find(object str, object substr, Py_ssize_t start, Py_ssize_t end, int direction) except -2 - - # Return the first position of the character ch in str[start:end] using - # the given direction (direction == 1 means to do a forward search, - # direction == -1 a backward search). The return value is the index of - # the first match; a value of -1 indicates that no match was found, and - # -2 indicates that an error occurred and an exception has been set. - # New in version 3.3. - Py_ssize_t PyUnicode_FindChar(object str, Py_UCS4 ch, Py_ssize_t start, Py_ssize_t end, int direction) except -2 - - # Return the number of non-overlapping occurrences of substr in - # str[start:end]. Return -1 if an error occurred. - Py_ssize_t PyUnicode_Count(object str, object substr, Py_ssize_t start, Py_ssize_t end) except -1 - - # Replace at most maxcount occurrences of substr in str with replstr and - # return the resulting Unicode object. maxcount == -1 means replace all - # occurrences. - # Return value: New reference. - unicode PyUnicode_Replace(object str, object substr, object replstr, Py_ssize_t maxcount) - - # Compare two strings and return -1, 0, 1 for less than, - # equal, and greater than, respectively. - int PyUnicode_Compare(object left, object right) except? -1 - - # Compare a unicode object, uni, with string and return -1, 0, 1 for less than, - # equal, and greater than, respectively. It is best to pass only ASCII-encoded - # strings, but the function interprets the input string as ISO-8859-1 if it - # contains non-ASCII characters. + +# Unicode Methods + + # Concat two strings giving a new Unicode string. + # Return value: New reference. + unicode PyUnicode_Concat(object left, object right) + + # Split a string giving a list of Unicode strings. If sep is NULL, + # splitting will be done at all whitespace substrings. Otherwise, + # splits occur at the given separator. At most maxsplit splits will + # be done. If negative, no limit is set. Separators are not included + # in the resulting list. + # Return value: New reference. + list PyUnicode_Split(object s, object sep, Py_ssize_t maxsplit) + + # Split a Unicode string at line breaks, returning a list of Unicode + # strings. CRLF is considered to be one line break. If keepend is 0, + # the Line break characters are not included in the resulting strings. + # Return value: New reference. + list PyUnicode_Splitlines(object s, bint keepend) + + # Translate a string by applying a character mapping table to it and + # return the resulting Unicode object. + # + # The mapping table must map Unicode ordinal integers to Unicode ordinal + # integers or None (causing deletion of the character). + # + # Mapping tables need only provide the __getitem__() interface; + # dictionaries and sequences work well. Unmapped character ordinals (ones + # which cause a LookupError) are left untouched and are copied as-is. + # + # errors has the usual meaning for codecs. It may be NULL which indicates + # to use the default error handling. + # Return value: New reference. + unicode PyUnicode_Translate(object str, object table, const char *errors) + + # Join a sequence of strings using the given separator and return the + # resulting Unicode string. + # Return value: New reference. + unicode PyUnicode_Join(object separator, object seq) + + # Return 1 if substr matches str[start:end] at the given tail end + # (direction == -1 means to do a prefix match, direction == 1 a + # suffix match), 0 otherwise. + # Return -1 if an error occurred. + Py_ssize_t PyUnicode_Tailmatch(object str, object substr, + Py_ssize_t start, Py_ssize_t end, int direction) except -1 + + # Return the first position of substr in str[start:end] using the given + # direction (direction == 1 means to do a forward search, direction == -1 + # a backward search). The return value is the index of the first match; + # a value of -1 indicates that no match was found, and -2 indicates that an + # error occurred and an exception has been set. + Py_ssize_t PyUnicode_Find(object str, object substr, Py_ssize_t start, Py_ssize_t end, int direction) except -2 + + # Return the first position of the character ch in str[start:end] using + # the given direction (direction == 1 means to do a forward search, + # direction == -1 a backward search). The return value is the index of + # the first match; a value of -1 indicates that no match was found, and + # -2 indicates that an error occurred and an exception has been set. + # New in version 3.3. + Py_ssize_t PyUnicode_FindChar(object str, Py_UCS4 ch, Py_ssize_t start, Py_ssize_t end, int direction) except -2 + + # Return the number of non-overlapping occurrences of substr in + # str[start:end]. Return -1 if an error occurred. + Py_ssize_t PyUnicode_Count(object str, object substr, Py_ssize_t start, Py_ssize_t end) except -1 + + # Replace at most maxcount occurrences of substr in str with replstr and + # return the resulting Unicode object. maxcount == -1 means replace all + # occurrences. + # Return value: New reference. + unicode PyUnicode_Replace(object str, object substr, object replstr, Py_ssize_t maxcount) + + # Compare two strings and return -1, 0, 1 for less than, + # equal, and greater than, respectively. + int PyUnicode_Compare(object left, object right) except? -1 + + # Compare a unicode object, uni, with string and return -1, 0, 1 for less than, + # equal, and greater than, respectively. It is best to pass only ASCII-encoded + # strings, but the function interprets the input string as ISO-8859-1 if it + # contains non-ASCII characters. int PyUnicode_CompareWithASCIIString(object uni, const char *string) - - # Rich compare two unicode strings and return one of the following: - # - # NULL in case an exception was raised - # Py_True or Py_False for successful comparisons - # Py_NotImplemented in case the type combination is unknown - # - # Note that Py_EQ and Py_NE comparisons can cause a UnicodeWarning in case - # the conversion of the arguments to Unicode fails with a UnicodeDecodeError. - # - # Possible values for op are Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, and Py_LE. - object PyUnicode_RichCompare(object left, object right, int op) - - # Return a new string object from format and args; this is analogous to - # format % args. - # Return value: New reference. - unicode PyUnicode_Format(object format, object args) - - # Check whether element is contained in container and return true or false - # accordingly. - # - # element has to coerce to a one element Unicode string. -1 is returned - # if there was an error. - int PyUnicode_Contains(object container, object element) except -1 - - # Intern the argument *string in place. The argument must be the address - # of a pointer variable pointing to a Python unicode string object. If - # there is an existing interned string that is the same as *string, it sets - # *string to it (decrementing the reference count of the old string object - # and incrementing the reference count of the interned string object), - # otherwise it leaves *string alone and interns it (incrementing its reference - # count). (Clarification: even though there is a lot of talk about reference - # counts, think of this function as reference-count-neutral; you own the object - # after the call if and only if you owned it before the call.) - #void PyUnicode_InternInPlace(PyObject **string) - - # A combination of PyUnicode_FromString() and PyUnicode_InternInPlace(), - # returning either a new unicode string object that has been interned, or - # a new ("owned") reference to an earlier interned string object with the - # same value. - unicode PyUnicode_InternFromString(const char *v) - - + + # Rich compare two unicode strings and return one of the following: + # + # NULL in case an exception was raised + # Py_True or Py_False for successful comparisons + # Py_NotImplemented in case the type combination is unknown + # + # Note that Py_EQ and Py_NE comparisons can cause a UnicodeWarning in case + # the conversion of the arguments to Unicode fails with a UnicodeDecodeError. + # + # Possible values for op are Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, and Py_LE. + object PyUnicode_RichCompare(object left, object right, int op) + + # Return a new string object from format and args; this is analogous to + # format % args. + # Return value: New reference. + unicode PyUnicode_Format(object format, object args) + + # Check whether element is contained in container and return true or false + # accordingly. + # + # element has to coerce to a one element Unicode string. -1 is returned + # if there was an error. + int PyUnicode_Contains(object container, object element) except -1 + + # Intern the argument *string in place. The argument must be the address + # of a pointer variable pointing to a Python unicode string object. If + # there is an existing interned string that is the same as *string, it sets + # *string to it (decrementing the reference count of the old string object + # and incrementing the reference count of the interned string object), + # otherwise it leaves *string alone and interns it (incrementing its reference + # count). (Clarification: even though there is a lot of talk about reference + # counts, think of this function as reference-count-neutral; you own the object + # after the call if and only if you owned it before the call.) + #void PyUnicode_InternInPlace(PyObject **string) + + # A combination of PyUnicode_FromString() and PyUnicode_InternInPlace(), + # returning either a new unicode string object that has been interned, or + # a new ("owned") reference to an earlier interned string object with the + # same value. + unicode PyUnicode_InternFromString(const char *v) + + # Codecs # Create a Unicode object by decoding size bytes of the encoded @@ -300,22 +300,22 @@ cdef extern from *: # Create a Unicode object by decoding size bytes of the UTF-8 # encoded string s. Return NULL if an exception was raised by the # codec. - unicode PyUnicode_DecodeUTF8(char *s, Py_ssize_t size, char *errors) + unicode PyUnicode_DecodeUTF8(char *s, Py_ssize_t size, char *errors) # If consumed is NULL, behave like PyUnicode_DecodeUTF8(). If # consumed is not NULL, trailing incomplete UTF-8 byte sequences # will not be treated as an error. Those bytes will not be decoded # and the number of bytes that have been decoded will be stored in # consumed. New in version 2.4. - unicode PyUnicode_DecodeUTF8Stateful(char *s, Py_ssize_t size, char *errors, Py_ssize_t *consumed) + unicode PyUnicode_DecodeUTF8Stateful(char *s, Py_ssize_t size, char *errors, Py_ssize_t *consumed) # Encode the Py_UNICODE buffer of the given size using UTF-8 and # return a Python string object. Return NULL if an exception was # raised by the codec. - bytes PyUnicode_EncodeUTF8(Py_UNICODE *s, Py_ssize_t size, char *errors) + bytes PyUnicode_EncodeUTF8(Py_UNICODE *s, Py_ssize_t size, char *errors) # Encode a Unicode objects using UTF-8 and return the result as Python string object. Error handling is ``strict''. Return NULL if an exception was raised by the codec. - bytes PyUnicode_AsUTF8String(object unicode) + bytes PyUnicode_AsUTF8String(object unicode) # These are the UTF-16 codec APIs: @@ -337,7 +337,7 @@ cdef extern from *: # order at the. # # If byteorder is NULL, the codec starts in native order mode. - unicode PyUnicode_DecodeUTF16(char *s, Py_ssize_t size, char *errors, int *byteorder) + unicode PyUnicode_DecodeUTF16(char *s, Py_ssize_t size, char *errors, int *byteorder) # If consumed is NULL, behave like PyUnicode_DecodeUTF16(). If # consumed is not NULL, PyUnicode_DecodeUTF16Stateful() will not @@ -345,7 +345,7 @@ cdef extern from *: # number of bytes or a split surrogate pair) as an error. Those # bytes will not be decoded and the number of bytes that have been # decoded will be stored in consumed. New in version 2.4. - unicode PyUnicode_DecodeUTF16Stateful(char *s, Py_ssize_t size, char *errors, int *byteorder, Py_ssize_t *consumed) + unicode PyUnicode_DecodeUTF16Stateful(char *s, Py_ssize_t size, char *errors, int *byteorder, Py_ssize_t *consumed) # Return a Python string object holding the UTF-16 encoded value # of the Unicode data in s. If byteorder is not 0, output is @@ -362,13 +362,13 @@ cdef extern from *: # If Py_UNICODE_WIDE is defined, a single Py_UNICODE value may get # represented as a surrogate pair. If it is not defined, each # Py_UNICODE values is interpreted as an UCS-2 character. - bytes PyUnicode_EncodeUTF16(Py_UNICODE *s, Py_ssize_t size, char *errors, int byteorder) + bytes PyUnicode_EncodeUTF16(Py_UNICODE *s, Py_ssize_t size, char *errors, int byteorder) # Return a Python string using the UTF-16 encoding in native byte # order. The string always starts with a BOM mark. Error handling # is ``strict''. Return NULL if an exception was raised by the # codec. - bytes PyUnicode_AsUTF16String(object unicode) + bytes PyUnicode_AsUTF16String(object unicode) # These are the ``Unicode Escape'' codec APIs: @@ -409,17 +409,17 @@ cdef extern from *: # Create a Unicode object by decoding size bytes of the Latin-1 # encoded string s. Return NULL if an exception was raised by the # codec. - unicode PyUnicode_DecodeLatin1(char *s, Py_ssize_t size, char *errors) + unicode PyUnicode_DecodeLatin1(char *s, Py_ssize_t size, char *errors) # Encode the Py_UNICODE buffer of the given size using Latin-1 and - # return a Python bytes object. Return NULL if an exception was + # return a Python bytes object. Return NULL if an exception was # raised by the codec. - bytes PyUnicode_EncodeLatin1(Py_UNICODE *s, Py_ssize_t size, char *errors) + bytes PyUnicode_EncodeLatin1(Py_UNICODE *s, Py_ssize_t size, char *errors) # Encode a Unicode objects using Latin-1 and return the result as - # Python bytes object. Error handling is ``strict''. Return NULL + # Python bytes object. Error handling is ``strict''. Return NULL # if an exception was raised by the codec. - bytes PyUnicode_AsLatin1String(object unicode) + bytes PyUnicode_AsLatin1String(object unicode) # These are the ASCII codec APIs. Only 7-bit ASCII data is # accepted. All other codes generate errors. @@ -427,17 +427,17 @@ cdef extern from *: # Create a Unicode object by decoding size bytes of the ASCII # encoded string s. Return NULL if an exception was raised by the # codec. - unicode PyUnicode_DecodeASCII(char *s, Py_ssize_t size, char *errors) + unicode PyUnicode_DecodeASCII(char *s, Py_ssize_t size, char *errors) # Encode the Py_UNICODE buffer of the given size using ASCII and - # return a Python bytes object. Return NULL if an exception was + # return a Python bytes object. Return NULL if an exception was # raised by the codec. - bytes PyUnicode_EncodeASCII(Py_UNICODE *s, Py_ssize_t size, char *errors) + bytes PyUnicode_EncodeASCII(Py_UNICODE *s, Py_ssize_t size, char *errors) # Encode a Unicode objects using ASCII and return the result as - # Python bytes object. Error handling is ``strict''. Return NULL + # Python bytes object. Error handling is ``strict''. Return NULL # if an exception was raised by the codec. - bytes PyUnicode_AsASCIIString(object o) + bytes PyUnicode_AsASCIIString(object o) # These are the mapping codec APIs: # @@ -478,8 +478,8 @@ cdef extern from *: # Encode the Py_UNICODE buffer of the given size using the given # mapping object and return a Python string object. Return NULL if # an exception was raised by the codec. - # - # Deprecated since version 3.3, will be removed in version 4.0. + # + # Deprecated since version 3.3, will be removed in version 4.0. object PyUnicode_EncodeCharmap(Py_UNICODE *s, Py_ssize_t size, object mapping, char *errors) # Encode a Unicode objects using the given mapping object and @@ -500,8 +500,8 @@ cdef extern from *: # dictionaries and sequences work well. Unmapped character # ordinals (ones which cause a LookupError) are left untouched and # are copied as-is. - # - # Deprecated since version 3.3, will be removed in version 4.0. + # + # Deprecated since version 3.3, will be removed in version 4.0. object PyUnicode_TranslateCharmap(Py_UNICODE *s, Py_ssize_t size, object table, char *errors) @@ -514,43 +514,43 @@ cdef extern from *: # Create a Unicode object by decoding size bytes of the MBCS # encoded string s. Return NULL if an exception was raised by the # codec. - unicode PyUnicode_DecodeMBCS(char *s, Py_ssize_t size, char *errors) + unicode PyUnicode_DecodeMBCS(char *s, Py_ssize_t size, char *errors) # If consumed is NULL, behave like PyUnicode_DecodeMBCS(). If # consumed is not NULL, PyUnicode_DecodeMBCSStateful() will not # decode trailing lead byte and the number of bytes that have been # decoded will be stored in consumed. New in version 2.5. # NOTE: Python 2.x uses 'int' values for 'size' and 'consumed' (changed in 3.0) - unicode PyUnicode_DecodeMBCSStateful(char *s, Py_ssize_t size, char *errors, Py_ssize_t *consumed) + unicode PyUnicode_DecodeMBCSStateful(char *s, Py_ssize_t size, char *errors, Py_ssize_t *consumed) # Encode the Py_UNICODE buffer of the given size using MBCS and # return a Python string object. Return NULL if an exception was # raised by the codec. - bytes PyUnicode_EncodeMBCS(Py_UNICODE *s, Py_ssize_t size, char *errors) + bytes PyUnicode_EncodeMBCS(Py_UNICODE *s, Py_ssize_t size, char *errors) # Encode a Unicode objects using MBCS and return the result as # Python string object. Error handling is ``strict''. Return NULL # if an exception was raised by the codec. - bytes PyUnicode_AsMBCSString(object o) - - # Encode the Unicode object using the specified code page and return - # a Python bytes object. Return NULL if an exception was raised by the - # codec. Use CP_ACP code page to get the MBCS encoder. - # - # New in version 3.3. - bytes PyUnicode_EncodeCodePage(int code_page, object unicode, const char *errors) - - -# Py_UCS4 helpers (new in CPython 3.3) - - # These utility functions work on strings of Py_UCS4 characters and - # otherwise behave like the C standard library functions with the same name. - - size_t Py_UCS4_strlen(const Py_UCS4 *u) - Py_UCS4* Py_UCS4_strcpy(Py_UCS4 *s1, const Py_UCS4 *s2) - Py_UCS4* Py_UCS4_strncpy(Py_UCS4 *s1, const Py_UCS4 *s2, size_t n) - Py_UCS4* Py_UCS4_strcat(Py_UCS4 *s1, const Py_UCS4 *s2) - int Py_UCS4_strcmp(const Py_UCS4 *s1, const Py_UCS4 *s2) - int Py_UCS4_strncmp(const Py_UCS4 *s1, const Py_UCS4 *s2, size_t n) - Py_UCS4* Py_UCS4_strchr(const Py_UCS4 *s, Py_UCS4 c) - Py_UCS4* Py_UCS4_strrchr(const Py_UCS4 *s, Py_UCS4 c) + bytes PyUnicode_AsMBCSString(object o) + + # Encode the Unicode object using the specified code page and return + # a Python bytes object. Return NULL if an exception was raised by the + # codec. Use CP_ACP code page to get the MBCS encoder. + # + # New in version 3.3. + bytes PyUnicode_EncodeCodePage(int code_page, object unicode, const char *errors) + + +# Py_UCS4 helpers (new in CPython 3.3) + + # These utility functions work on strings of Py_UCS4 characters and + # otherwise behave like the C standard library functions with the same name. + + size_t Py_UCS4_strlen(const Py_UCS4 *u) + Py_UCS4* Py_UCS4_strcpy(Py_UCS4 *s1, const Py_UCS4 *s2) + Py_UCS4* Py_UCS4_strncpy(Py_UCS4 *s1, const Py_UCS4 *s2, size_t n) + Py_UCS4* Py_UCS4_strcat(Py_UCS4 *s1, const Py_UCS4 *s2) + int Py_UCS4_strcmp(const Py_UCS4 *s1, const Py_UCS4 *s2) + int Py_UCS4_strncmp(const Py_UCS4 *s1, const Py_UCS4 *s2, size_t n) + Py_UCS4* Py_UCS4_strchr(const Py_UCS4 *s, Py_UCS4 c) + Py_UCS4* Py_UCS4_strrchr(const Py_UCS4 *s, Py_UCS4 c) diff --git a/contrib/tools/cython/Cython/Includes/cpython/weakref.pxd b/contrib/tools/cython/Cython/Includes/cpython/weakref.pxd index 9c4b50f564..de5a28027a 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/weakref.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/weakref.pxd @@ -1,4 +1,4 @@ -from .object cimport PyObject +from .object cimport PyObject cdef extern from "Python.h": |