diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/tools/cython/Cython/Includes | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/tools/cython/Cython/Includes')
21 files changed, 535 insertions, 535 deletions
diff --git a/contrib/tools/cython/Cython/Includes/cpython/array.pxd b/contrib/tools/cython/Cython/Includes/cpython/array.pxd index f19264624a..19230a0a82 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/array.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/array.pxd @@ -131,14 +131,14 @@ cdef inline array clone(array template, Py_ssize_t length, bint zero): """ fast creation of a new array, given a template array. type will be same as template. if zero is true, new array will be initialized with zeroes.""" - cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) + cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) if zero and op is not None: memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) return op cdef inline array copy(array self): """ make a copy of an array. """ - cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) + cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) return op diff --git a/contrib/tools/cython/Cython/Includes/cpython/buffer.pxd b/contrib/tools/cython/Cython/Includes/cpython/buffer.pxd index e9b4cefc45..3f1ada774a 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/buffer.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/buffer.pxd @@ -3,9 +3,9 @@ cdef extern from "Python.h": cdef enum: - PyBUF_MAX_NDIM - - cdef enum: + PyBUF_MAX_NDIM + + cdef enum: PyBUF_SIMPLE, PyBUF_WRITABLE, PyBUF_WRITEABLE, # backwards compatibility diff --git a/contrib/tools/cython/Cython/Includes/cpython/cellobject.pxd b/contrib/tools/cython/Cython/Includes/cpython/cellobject.pxd index fc3605ca4d..5e3dd3d63c 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/cellobject.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/cellobject.pxd @@ -1,35 +1,35 @@ -from .object cimport PyObject - -cdef extern from "Python.h": - - ############################################################################ - # Cell Objects - ############################################################################ - - bint PyCell_Check(object ob) - # Return true if ob is a cell object; ob must not be NULL. - - object PyCell_New(PyObject* ob) - # Return value: New reference. - # Create and return a new cell object containing the value ob. The - # parameter may be NULL. - - object PyCell_Get(object cell) - # Return value: New reference. - # Return the contents of the cell object cell. - - object PyCell_GET(object cell) - # Return value: Borrowed reference. - # Return the contents of the cell object cell, but without checking that - # cell is non-NULL and is a cell object. - - int PyCell_Set(object cell, PyObject* value) except? -1 - # Set the contents of the cell object cell to value. This releases the - # reference to any current content of the cell. value may be NULL. cell - # must be non-NULL; if it is not a cell object, -1 will be returned. On - # success, 0 will be returned. - - void PyCell_SET(object cell, PyObject* value) - # Sets the value of the cell object cell to value. No reference counts are - # adjusted, and no checks are made for safety; cell must be non-NULL and - # must be a cell object. +from .object cimport PyObject + +cdef extern from "Python.h": + + ############################################################################ + # Cell Objects + ############################################################################ + + bint PyCell_Check(object ob) + # Return true if ob is a cell object; ob must not be NULL. + + object PyCell_New(PyObject* ob) + # Return value: New reference. + # Create and return a new cell object containing the value ob. The + # parameter may be NULL. + + object PyCell_Get(object cell) + # Return value: New reference. + # Return the contents of the cell object cell. + + object PyCell_GET(object cell) + # Return value: Borrowed reference. + # Return the contents of the cell object cell, but without checking that + # cell is non-NULL and is a cell object. + + int PyCell_Set(object cell, PyObject* value) except? -1 + # Set the contents of the cell object cell to value. This releases the + # reference to any current content of the cell. value may be NULL. cell + # must be non-NULL; if it is not a cell object, -1 will be returned. On + # success, 0 will be returned. + + void PyCell_SET(object cell, PyObject* value) + # Sets the value of the cell object cell to value. No reference counts are + # adjusted, and no checks are made for safety; cell must be non-NULL and + # must be a cell object. diff --git a/contrib/tools/cython/Cython/Includes/cpython/codecs.pxd b/contrib/tools/cython/Cython/Includes/cpython/codecs.pxd index dd57020bc1..f2ca7d2444 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/codecs.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/codecs.pxd @@ -1,121 +1,121 @@ -cdef extern from "Python.h": - - ########################################################################### - # Codec registry and support functions - ########################################################################### - - int PyCodec_Register(object search_function) - # Register a new codec search function. - - # As side effect, this tries to load the encodings package, if not yet - # done, to make sure that it is always first in the list of search - # functions. - - int PyCodec_KnownEncoding(const char *encoding) - # Return 1 or 0 depending on whether there is a registered codec for the - # given encoding. This function always succeeds. - - object PyCodec_Encode(object o, const char *encoding, const char *errors) - # Return value: New reference. - # Generic codec based encoding API. - - # o is passed through the encoder function found for the given encoding - # using the error handling method defined by errors. errors may be NULL - # to use the default method defined for the codec. Raises a LookupError - # if no encoder can be found. - - object PyCodec_Decode(object o, const char *encoding, const char *errors) - # Return value: New reference. - # Generic codec based decoding API. - - # o is passed through the decoder function found for the given encoding - # using the error handling method defined by errors. errors may be NULL - # to use the default method defined for the codec. Raises a LookupError - # if no encoder can be found. - - - # Codec lookup API - - # In the following functions, the encoding string is looked up converted - # to all lower-case characters, which makes encodings looked up through - # this mechanism effectively case-insensitive. If no codec is found, a - # KeyError is set and NULL returned. - - object PyCodec_Encoder(const char *encoding) - # Return value: New reference. - # Get an encoder function for the given encoding. - - object PyCodec_Decoder(const char *encoding) - # Return value: New reference. - # Get a decoder function for the given encoding. - - object PyCodec_IncrementalEncoder(const char *encoding, const char *errors) - # Return value: New reference. - # Get an IncrementalEncoder object for the given encoding. - - object PyCodec_IncrementalDecoder(const char *encoding, const char *errors) - # Return value: New reference. - # Get an IncrementalDecoder object for the given encoding. - - object PyCodec_StreamReader(const char *encoding, object stream, const char *errors) - # Return value: New reference. - # Get a StreamReader factory function for the given encoding. - - object PyCodec_StreamWriter(const char *encoding, object stream, const char *errors) - # Return value: New reference. - # Get a StreamWriter factory function for the given encoding. - - - # Registry API for Unicode encoding error handlers - - int PyCodec_RegisterError(const char *name, object error) except? -1 - # Register the error handling callback function error under the given - # name. This callback function will be called by a codec when it - # encounters unencodable characters/undecodable bytes and name is - # specified as the error parameter in the call to the encode/decode - # function. - - # The callback gets a single argument, an instance of - # UnicodeEncodeError, UnicodeDecodeError or UnicodeTranslateError that - # holds information about the problematic sequence of characters or bytes - # and their offset in the original string (see Unicode Exception Objects - # for functions to extract this information). The callback must either - # raise the given exception, or return a two-item tuple containing the - # replacement for the problematic sequence, and an integer giving the - # offset in the original string at which encoding/decoding should be - # resumed. - - # Return 0 on success, -1 on error. - - object PyCodec_LookupError(const char *name) - # Return value: New reference. - # Lookup the error handling callback function registered under name. As a - # special case NULL can be passed, in which case the error handling - # callback for "strict" will be returned. - - object PyCodec_StrictErrors(object exc) - # Return value: Always NULL. - # Raise exc as an exception. - - object PyCodec_IgnoreErrors(object exc) - # Return value: New reference. - # Ignore the unicode error, skipping the faulty input. - - object PyCodec_ReplaceErrors(object exc) - # Return value: New reference. - # Replace the unicode encode error with "?" or "U+FFFD". - - object PyCodec_XMLCharRefReplaceErrors(object exc) - # Return value: New reference. - # Replace the unicode encode error with XML character references. - - object PyCodec_BackslashReplaceErrors(object exc) - # Return value: New reference. - # Replace the unicode encode error with backslash escapes ("\x", "\u" - # and "\U"). - - object PyCodec_NameReplaceErrors(object exc) - # Return value: New reference. - # Replace the unicode encode error with "\N{...}" escapes. - - # New in version 3.5. +cdef extern from "Python.h": + + ########################################################################### + # Codec registry and support functions + ########################################################################### + + int PyCodec_Register(object search_function) + # Register a new codec search function. + + # As side effect, this tries to load the encodings package, if not yet + # done, to make sure that it is always first in the list of search + # functions. + + int PyCodec_KnownEncoding(const char *encoding) + # Return 1 or 0 depending on whether there is a registered codec for the + # given encoding. This function always succeeds. + + object PyCodec_Encode(object o, const char *encoding, const char *errors) + # Return value: New reference. + # Generic codec based encoding API. + + # o is passed through the encoder function found for the given encoding + # using the error handling method defined by errors. errors may be NULL + # to use the default method defined for the codec. Raises a LookupError + # if no encoder can be found. + + object PyCodec_Decode(object o, const char *encoding, const char *errors) + # Return value: New reference. + # Generic codec based decoding API. + + # o is passed through the decoder function found for the given encoding + # using the error handling method defined by errors. errors may be NULL + # to use the default method defined for the codec. Raises a LookupError + # if no encoder can be found. + + + # Codec lookup API + + # In the following functions, the encoding string is looked up converted + # to all lower-case characters, which makes encodings looked up through + # this mechanism effectively case-insensitive. If no codec is found, a + # KeyError is set and NULL returned. + + object PyCodec_Encoder(const char *encoding) + # Return value: New reference. + # Get an encoder function for the given encoding. + + object PyCodec_Decoder(const char *encoding) + # Return value: New reference. + # Get a decoder function for the given encoding. + + object PyCodec_IncrementalEncoder(const char *encoding, const char *errors) + # Return value: New reference. + # Get an IncrementalEncoder object for the given encoding. + + object PyCodec_IncrementalDecoder(const char *encoding, const char *errors) + # Return value: New reference. + # Get an IncrementalDecoder object for the given encoding. + + object PyCodec_StreamReader(const char *encoding, object stream, const char *errors) + # Return value: New reference. + # Get a StreamReader factory function for the given encoding. + + object PyCodec_StreamWriter(const char *encoding, object stream, const char *errors) + # Return value: New reference. + # Get a StreamWriter factory function for the given encoding. + + + # Registry API for Unicode encoding error handlers + + int PyCodec_RegisterError(const char *name, object error) except? -1 + # Register the error handling callback function error under the given + # name. This callback function will be called by a codec when it + # encounters unencodable characters/undecodable bytes and name is + # specified as the error parameter in the call to the encode/decode + # function. + + # The callback gets a single argument, an instance of + # UnicodeEncodeError, UnicodeDecodeError or UnicodeTranslateError that + # holds information about the problematic sequence of characters or bytes + # and their offset in the original string (see Unicode Exception Objects + # for functions to extract this information). The callback must either + # raise the given exception, or return a two-item tuple containing the + # replacement for the problematic sequence, and an integer giving the + # offset in the original string at which encoding/decoding should be + # resumed. + + # Return 0 on success, -1 on error. + + object PyCodec_LookupError(const char *name) + # Return value: New reference. + # Lookup the error handling callback function registered under name. As a + # special case NULL can be passed, in which case the error handling + # callback for "strict" will be returned. + + object PyCodec_StrictErrors(object exc) + # Return value: Always NULL. + # Raise exc as an exception. + + object PyCodec_IgnoreErrors(object exc) + # Return value: New reference. + # Ignore the unicode error, skipping the faulty input. + + object PyCodec_ReplaceErrors(object exc) + # Return value: New reference. + # Replace the unicode encode error with "?" or "U+FFFD". + + object PyCodec_XMLCharRefReplaceErrors(object exc) + # Return value: New reference. + # Replace the unicode encode error with XML character references. + + object PyCodec_BackslashReplaceErrors(object exc) + # Return value: New reference. + # Replace the unicode encode error with backslash escapes ("\x", "\u" + # and "\U"). + + object PyCodec_NameReplaceErrors(object exc) + # Return value: New reference. + # Replace the unicode encode error with "\N{...}" escapes. + + # New in version 3.5. diff --git a/contrib/tools/cython/Cython/Includes/cpython/conversion.pxd b/contrib/tools/cython/Cython/Includes/cpython/conversion.pxd index f779f52673..18e2c3d1a6 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/conversion.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/conversion.pxd @@ -1,36 +1,36 @@ -# From https://docs.python.org/3/c-api/conversion.html - -from .object cimport PyObject - -cdef extern from "Python.h": - ctypedef struct va_list - - int PyOS_snprintf(char *str, size_t size, const char *format, ...) - # Output not more than size bytes to str according to the format - # string format and the extra arguments. See the Unix man page snprintf(2). - - int PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va) - # Output not more than size bytes to str according to the format - # string format and the variable argument list va. Unix man page vsnprintf(2). - - double PyOS_string_to_double(const char *s, char **endptr, PyObject *overflow_exception) except? -1.0 - # Convert a string s to a double, raising a Python exception on failure. The set of - # accepted strings corresponds to the set of strings accepted by Python’s float() - # constructor, except that s must not have leading or trailing whitespace. - # The conversion is independent of the current locale. - - enum: - Py_DTSF_SIGN - Py_DTSF_ADD_DOT_0 - Py_DTSF_ALT - - char* PyOS_double_to_string(double val, char format_code, int precision, int flags, int *ptype) except NULL - # Convert a double val to a string using supplied format_code, precision, and flags. - - int PyOS_stricmp(const char *s1, const char *s2) - # Case insensitive comparison of strings. The function works almost identically - # to strcmp() except that it ignores the case. - - int PyOS_strnicmp(const char *s1, const char *s2, Py_ssize_t size) - # Case insensitive comparison of strings. The function works almost identically - # to strncmp() except that it ignores the case. +# From https://docs.python.org/3/c-api/conversion.html + +from .object cimport PyObject + +cdef extern from "Python.h": + ctypedef struct va_list + + int PyOS_snprintf(char *str, size_t size, const char *format, ...) + # Output not more than size bytes to str according to the format + # string format and the extra arguments. See the Unix man page snprintf(2). + + int PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va) + # Output not more than size bytes to str according to the format + # string format and the variable argument list va. Unix man page vsnprintf(2). + + double PyOS_string_to_double(const char *s, char **endptr, PyObject *overflow_exception) except? -1.0 + # Convert a string s to a double, raising a Python exception on failure. The set of + # accepted strings corresponds to the set of strings accepted by Python’s float() + # constructor, except that s must not have leading or trailing whitespace. + # The conversion is independent of the current locale. + + enum: + Py_DTSF_SIGN + Py_DTSF_ADD_DOT_0 + Py_DTSF_ALT + + char* PyOS_double_to_string(double val, char format_code, int precision, int flags, int *ptype) except NULL + # Convert a double val to a string using supplied format_code, precision, and flags. + + int PyOS_stricmp(const char *s1, const char *s2) + # Case insensitive comparison of strings. The function works almost identically + # to strcmp() except that it ignores the case. + + int PyOS_strnicmp(const char *s1, const char *s2, Py_ssize_t size) + # Case insensitive comparison of strings. The function works almost identically + # to strncmp() except that it ignores the case. diff --git a/contrib/tools/cython/Cython/Includes/cpython/datetime.pxd b/contrib/tools/cython/Cython/Includes/cpython/datetime.pxd index d3c80b07df..cd0f90719b 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/datetime.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/datetime.pxd @@ -90,9 +90,9 @@ cdef extern from "datetime.h": int PyDateTime_TIME_GET_MICROSECOND(object o) # Getters for timedelta (C macros). - int PyDateTime_DELTA_GET_DAYS(object o) - int PyDateTime_DELTA_GET_SECONDS(object o) - int PyDateTime_DELTA_GET_MICROSECONDS(object o) + int PyDateTime_DELTA_GET_DAYS(object o) + int PyDateTime_DELTA_GET_SECONDS(object o) + int PyDateTime_DELTA_GET_MICROSECONDS(object o) # PyDateTime CAPI object. PyDateTime_CAPI *PyDateTimeAPI diff --git a/contrib/tools/cython/Cython/Includes/cpython/genobject.pxd b/contrib/tools/cython/Cython/Includes/cpython/genobject.pxd index 0dd63fbbf0..337b3cc0ad 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/genobject.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/genobject.pxd @@ -1,25 +1,25 @@ -from .pystate cimport PyFrameObject - -cdef extern from "Python.h": - - ########################################################################### - # Generator Objects - ########################################################################### - - bint PyGen_Check(object ob) - # Return true if ob is a generator object; ob must not be NULL. - - bint PyGen_CheckExact(object ob) - # Return true if ob's type is PyGen_Type; ob must not be NULL. - - object PyGen_New(PyFrameObject *frame) - # Return value: New reference. - # Create and return a new generator object based on the frame object. A - # reference to frame is stolen by this function. The argument must not be - # NULL. - - object PyGen_NewWithQualName(PyFrameObject *frame, object name, object qualname) - # Return value: New reference. - # Create and return a new generator object based on the frame object, with - # __name__ and __qualname__ set to name and qualname. A reference to frame - # is stolen by this function. The frame argument must not be NULL. +from .pystate cimport PyFrameObject + +cdef extern from "Python.h": + + ########################################################################### + # Generator Objects + ########################################################################### + + bint PyGen_Check(object ob) + # Return true if ob is a generator object; ob must not be NULL. + + bint PyGen_CheckExact(object ob) + # Return true if ob's type is PyGen_Type; ob must not be NULL. + + object PyGen_New(PyFrameObject *frame) + # Return value: New reference. + # Create and return a new generator object based on the frame object. A + # reference to frame is stolen by this function. The argument must not be + # NULL. + + object PyGen_NewWithQualName(PyFrameObject *frame, object name, object qualname) + # Return value: New reference. + # Create and return a new generator object based on the frame object, with + # __name__ and __qualname__ set to name and qualname. A reference to frame + # is stolen by this function. The frame argument must not be NULL. diff --git a/contrib/tools/cython/Cython/Includes/cpython/iterobject.pxd b/contrib/tools/cython/Cython/Includes/cpython/iterobject.pxd index 8aa0387ca9..a70aeccb09 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/iterobject.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/iterobject.pxd @@ -1,24 +1,24 @@ -cdef extern from "Python.h": - - ########################################################################### - # Iterator Objects - ########################################################################### - - bint PySeqIter_Check(object op) - # Return true if the type of op is PySeqIter_Type. - - object PySeqIter_New(object seq) - # Return value: New reference. - # Return an iterator that works with a general sequence object, seq. The - # iteration ends when the sequence raises IndexError for the subscripting - # operation. - - bint PyCallIter_Check(object op) - # Return true if the type of op is PyCallIter_Type. - - object PyCallIter_New(object callable, object sentinel) - # Return value: New reference. - # Return a new iterator. The first parameter, callable, can be any Python - # callable object that can be called with no parameters; each call to it - # should return the next item in the iteration. When callable returns a - # value equal to sentinel, the iteration will be terminated. +cdef extern from "Python.h": + + ########################################################################### + # Iterator Objects + ########################################################################### + + bint PySeqIter_Check(object op) + # Return true if the type of op is PySeqIter_Type. + + object PySeqIter_New(object seq) + # Return value: New reference. + # Return an iterator that works with a general sequence object, seq. The + # iteration ends when the sequence raises IndexError for the subscripting + # operation. + + bint PyCallIter_Check(object op) + # Return true if the type of op is PyCallIter_Type. + + object PyCallIter_New(object callable, object sentinel) + # Return value: New reference. + # Return a new iterator. The first parameter, callable, can be any Python + # callable object that can be called with no parameters; each call to it + # should return the next item in the iteration. When callable returns a + # value equal to sentinel, the iteration will be terminated. diff --git a/contrib/tools/cython/Cython/Includes/cpython/longintrepr.pxd b/contrib/tools/cython/Cython/Includes/cpython/longintrepr.pxd index efae540d05..c38c1bff88 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/longintrepr.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/longintrepr.pxd @@ -1,11 +1,11 @@ # 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 - """ +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 diff --git a/contrib/tools/cython/Cython/Includes/cpython/memoryview.pxd b/contrib/tools/cython/Cython/Includes/cpython/memoryview.pxd index 8274f42af9..83a84e6f91 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/memoryview.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/memoryview.pxd @@ -1,50 +1,50 @@ -cdef extern from "Python.h": - - ########################################################################### - # MemoryView Objects - ########################################################################### - # A memoryview object exposes the C level buffer interface as a Python - # object which can then be passed around like any other object - - object PyMemoryView_FromObject(object obj) - # Return value: New reference. - # Create a memoryview object from an object that provides the buffer - # interface. If obj supports writable buffer exports, the memoryview object - # will be read/write, otherwise it may be either read-only or read/write at - # the discretion of the exporter. - - object PyMemoryView_FromMemory(char *mem, Py_ssize_t size, int flags) - # Return value: New reference. - # Create a memoryview object using mem as the underlying buffer. flags can - # be one of PyBUF_READ or PyBUF_WRITE. - # New in version 3.3. - - object PyMemoryView_FromBuffer(Py_buffer *view) - # Return value: New reference. - # Create a memoryview object wrapping the given buffer structure view. For - # simple byte buffers, PyMemoryView_FromMemory() is the preferred function. - - object PyMemoryView_GetContiguous(object obj, - int buffertype, - char order) - # Return value: New reference. - # Create a memoryview object to a contiguous chunk of memory (in either ‘C’ - # or ‘F’ortran order) from an object that defines the buffer interface. If - # memory is contiguous, the memoryview object points to the original - # memory. Otherwise, a copy is made and the memoryview points to a new - # bytes object. - - bint PyMemoryView_Check(object obj) - # Return true if the object obj is a memoryview object. It is not currently - # allowed to create subclasses of memoryview. - - Py_buffer *PyMemoryView_GET_BUFFER(object mview) - # Return a pointer to the memoryview’s private copy of the exporter’s - # buffer. mview must be a memoryview instance; this macro doesn’t check its - # type, you must do it yourself or you will risk crashes. - - Py_buffer *PyMemoryView_GET_BASE(object mview) - # Return either a pointer to the exporting object that the memoryview is - # based on or NULL if the memoryview has been created by one of the - # functions PyMemoryView_FromMemory() or PyMemoryView_FromBuffer(). mview - # must be a memoryview instance. +cdef extern from "Python.h": + + ########################################################################### + # MemoryView Objects + ########################################################################### + # A memoryview object exposes the C level buffer interface as a Python + # object which can then be passed around like any other object + + object PyMemoryView_FromObject(object obj) + # Return value: New reference. + # Create a memoryview object from an object that provides the buffer + # interface. If obj supports writable buffer exports, the memoryview object + # will be read/write, otherwise it may be either read-only or read/write at + # the discretion of the exporter. + + object PyMemoryView_FromMemory(char *mem, Py_ssize_t size, int flags) + # Return value: New reference. + # Create a memoryview object using mem as the underlying buffer. flags can + # be one of PyBUF_READ or PyBUF_WRITE. + # New in version 3.3. + + object PyMemoryView_FromBuffer(Py_buffer *view) + # Return value: New reference. + # Create a memoryview object wrapping the given buffer structure view. For + # simple byte buffers, PyMemoryView_FromMemory() is the preferred function. + + object PyMemoryView_GetContiguous(object obj, + int buffertype, + char order) + # Return value: New reference. + # Create a memoryview object to a contiguous chunk of memory (in either ‘C’ + # or ‘F’ortran order) from an object that defines the buffer interface. If + # memory is contiguous, the memoryview object points to the original + # memory. Otherwise, a copy is made and the memoryview points to a new + # bytes object. + + bint PyMemoryView_Check(object obj) + # Return true if the object obj is a memoryview object. It is not currently + # allowed to create subclasses of memoryview. + + Py_buffer *PyMemoryView_GET_BUFFER(object mview) + # Return a pointer to the memoryview’s private copy of the exporter’s + # buffer. mview must be a memoryview instance; this macro doesn’t check its + # type, you must do it yourself or you will risk crashes. + + Py_buffer *PyMemoryView_GET_BASE(object mview) + # Return either a pointer to the exporting object that the memoryview is + # based on or NULL if the memoryview has been created by one of the + # functions PyMemoryView_FromMemory() or PyMemoryView_FromBuffer(). mview + # must be a memoryview instance. diff --git a/contrib/tools/cython/Cython/Includes/cpython/number.pxd b/contrib/tools/cython/Cython/Includes/cpython/number.pxd index df6c637c33..ded35c292a 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/number.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/number.pxd @@ -27,13 +27,13 @@ cdef extern from "Python.h": # failure. This is the equivalent of the Python expression "o1 * # o2". - object PyNumber_MatrixMultiply(object o1, object o2) - # Return value: New reference. - # Returns the result of matrix multiplication on o1 and o2, or - # NULL on failure. This is the equivalent of the Python - # expression "o1 @ o2". - # New in version 3.5. - + object PyNumber_MatrixMultiply(object o1, object o2) + # Return value: New reference. + # Returns the result of matrix multiplication on o1 and o2, or + # NULL on failure. This is the equivalent of the Python + # expression "o1 @ o2". + # New in version 3.5. + object PyNumber_Divide(object o1, object o2) # Return value: New reference. # Returns the result of dividing o1 by o2, or NULL on @@ -140,13 +140,13 @@ cdef extern from "Python.h": # failure. The operation is done in-place when o1 supports # it. This is the equivalent of the Python statement "o1 *= o2". - object PyNumber_InPlaceMatrixMultiply(object o1, object o2) - # Return value: New reference. - # Returns the result of matrix multiplication on o1 and o2, or - # NULL on failure. The operation is done in-place when o1 supports - # it. This is the equivalent of the Python statement "o1 @= o2". - # New in version 3.5. - + object PyNumber_InPlaceMatrixMultiply(object o1, object o2) + # Return value: New reference. + # Returns the result of matrix multiplication on o1 and o2, or + # NULL on failure. The operation is done in-place when o1 supports + # it. This is the equivalent of the Python statement "o1 @= o2". + # New in version 3.5. + object PyNumber_InPlaceDivide(object o1, object o2) # Return value: New reference. # Returns the result of dividing o1 by o2, or NULL on failure. The diff --git a/contrib/tools/cython/Cython/Includes/cpython/pycapsule.pxd b/contrib/tools/cython/Cython/Includes/cpython/pycapsule.pxd index 31aa5f5b7f..c3d12c7490 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/pycapsule.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/pycapsule.pxd @@ -24,7 +24,7 @@ cdef extern from "Python.h": # Return true if its argument is a PyCapsule. - object PyCapsule_New(void *pointer, const char *name, + object PyCapsule_New(void *pointer, const char *name, PyCapsule_Destructor destructor) # Return value: New reference. # @@ -47,7 +47,7 @@ cdef extern from "Python.h": # PyCapsule_Import(). - void* PyCapsule_GetPointer(object capsule, const char *name) except? NULL + void* PyCapsule_GetPointer(object capsule, const char *name) except? NULL # Retrieve the pointer stored in the capsule. On failure, set an # exception and return NULL. # @@ -66,7 +66,7 @@ cdef extern from "Python.h": # or PyErr_Occurred() to disambiguate. - const char* PyCapsule_GetName(object capsule) except? NULL + const char* PyCapsule_GetName(object capsule) except? NULL # Return the current name stored in the capsule. On failure, set # an exception and return NULL. # @@ -84,7 +84,7 @@ cdef extern from "Python.h": # PyErr_Occurred() to disambiguate. - bint PyCapsule_IsValid(object capsule, const char *name) + bint PyCapsule_IsValid(object capsule, const char *name) # Determines whether or not capsule is a valid capsule. A valid # capsule is non-NULL, passes PyCapsule_CheckExact(), has a # non-NULL pointer stored in it, and its internal name matches the @@ -114,7 +114,7 @@ cdef extern from "Python.h": # failure. - int PyCapsule_SetName(object capsule, const char *name) except -1 + int PyCapsule_SetName(object capsule, const char *name) except -1 # Set the name inside capsule to name. If non-NULL, the name must # outlive the capsule. If the previous name stored in the capsule # was not NULL, no attempt is made to free it. @@ -128,7 +128,7 @@ cdef extern from "Python.h": # success. Return nonzero and set an exception on failure. - void* PyCapsule_Import(const char *name, int no_block) except? NULL + void* PyCapsule_Import(const char *name, int no_block) except? NULL # Import a pointer to a C object from a capsule attribute in a # module. The name parameter should specify the full name to the # attribute, as in module.attribute. The name stored in the diff --git a/contrib/tools/cython/Cython/Includes/cpython/pylifecycle.pxd b/contrib/tools/cython/Cython/Includes/cpython/pylifecycle.pxd index 919c18c487..2c71e37163 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/pylifecycle.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/pylifecycle.pxd @@ -27,9 +27,9 @@ cdef extern from "Python.h": void Py_EndInterpreter(PyThreadState *) - # _Py_PyAtExit is for the atexit module, Py_AtExit is for low-level + # _Py_PyAtExit is for the atexit module, Py_AtExit is for low-level # exit functions. - void _Py_PyAtExit(void (*func)(object), object) + void _Py_PyAtExit(void (*func)(object), object) int Py_AtExit(void (*func)()) void Py_Exit(int) diff --git a/contrib/tools/cython/Cython/Includes/cpython/slice.pxd b/contrib/tools/cython/Cython/Includes/cpython/slice.pxd index ea81cbc3fe..202dea716c 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/slice.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/slice.pxd @@ -45,26 +45,26 @@ cdef extern from "Python.h": # # 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 - # Extract the start, stop and step data members from a slice object as C - # integers. Silently reduce values larger than PY_SSIZE_T_MAX to - # PY_SSIZE_T_MAX, silently boost the start and stop values less than - # PY_SSIZE_T_MIN to PY_SSIZE_T_MIN, and silently boost the step values - # less than -PY_SSIZE_T_MAX to -PY_SSIZE_T_MAX. - - # Return -1 on error, 0 on success. - - # New in version 3.6.1. - - Py_ssize_t PySlice_AdjustIndices(Py_ssize_t length, Py_ssize_t *start, - Py_ssize_t *stop, Py_ssize_t step) - # Adjust start/end slice indices assuming a sequence of the specified - # length. Out of bounds indices are clipped in a manner consistent with - # the handling of normal slices. - - # Return the length of the slice. Always successful. Doesn’t call Python - # code. - - # New in version 3.6.1. + + int PySlice_Unpack(object slice, Py_ssize_t *start, Py_ssize_t *stop, + Py_ssize_t *step) except -1 + # Extract the start, stop and step data members from a slice object as C + # integers. Silently reduce values larger than PY_SSIZE_T_MAX to + # PY_SSIZE_T_MAX, silently boost the start and stop values less than + # PY_SSIZE_T_MIN to PY_SSIZE_T_MIN, and silently boost the step values + # less than -PY_SSIZE_T_MAX to -PY_SSIZE_T_MAX. + + # Return -1 on error, 0 on success. + + # New in version 3.6.1. + + Py_ssize_t PySlice_AdjustIndices(Py_ssize_t length, Py_ssize_t *start, + Py_ssize_t *stop, Py_ssize_t step) + # Adjust start/end slice indices assuming a sequence of the specified + # length. Out of bounds indices are clipped in a manner consistent with + # the handling of normal slices. + + # Return the length of the slice. Always successful. Doesn’t call Python + # code. + + # New in version 3.6.1. diff --git a/contrib/tools/cython/Cython/Includes/cpython/unicode.pxd b/contrib/tools/cython/Cython/Includes/cpython/unicode.pxd index 6e412e3324..ad01ed64df 100644 --- a/contrib/tools/cython/Cython/Includes/cpython/unicode.pxd +++ b/contrib/tools/cython/Cython/Includes/cpython/unicode.pxd @@ -10,19 +10,19 @@ cdef extern from *: # Return the size of the object. o has to be a PyUnicodeObject # (not checked). - # - # Deprecated since version 3.3, will be removed in version 3.10: - # Part of the old-style Unicode API, please migrate to using - # PyUnicode_GET_LENGTH(). + # + # Deprecated since version 3.3, will be removed in version 3.10: + # Part of the old-style Unicode API, please migrate to using + # PyUnicode_GET_LENGTH(). Py_ssize_t PyUnicode_GET_SIZE(object o) - # Return the length of the Unicode string, in code points. o has - # to be a Unicode object in the “canonical” representation (not - # checked). - # - # New in version 3.3. - Py_ssize_t PyUnicode_GET_LENGTH(object o) - + # Return the length of the Unicode string, in code points. o has + # to be a Unicode object in the “canonical” representation (not + # checked). + # + # New in version 3.3. + Py_ssize_t PyUnicode_GET_LENGTH(object o) + # Return the size of the object's internal buffer in bytes. o has # to be a PyUnicodeObject (not checked). Py_ssize_t PyUnicode_GET_DATA_SIZE(object o) @@ -226,7 +226,7 @@ cdef extern from *: # 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) + int PyUnicode_CompareWithASCIIString(object uni, const char *string) # Rich compare two unicode strings and return one of the following: # diff --git a/contrib/tools/cython/Cython/Includes/libc/math.pxd b/contrib/tools/cython/Cython/Includes/libc/math.pxd index eef987c73e..b002670b22 100644 --- a/contrib/tools/cython/Cython/Includes/libc/math.pxd +++ b/contrib/tools/cython/Cython/Includes/libc/math.pxd @@ -104,9 +104,9 @@ cdef extern from "<math.h>" nogil: bint isnan(long double) bint isnormal(long double) bint signbit(long double) - int fpclassify(long double) - const int FP_NAN - const int FP_INFINITE - const int FP_ZERO - const int FP_SUBNORMAL - const int FP_NORMAL + int fpclassify(long double) + const int FP_NAN + const int FP_INFINITE + const int FP_ZERO + const int FP_SUBNORMAL + const int FP_NORMAL diff --git a/contrib/tools/cython/Cython/Includes/libcpp/string.pxd b/contrib/tools/cython/Cython/Includes/libcpp/string.pxd index 14fe5ede4b..a894144f1f 100644 --- a/contrib/tools/cython/Cython/Includes/libcpp/string.pxd +++ b/contrib/tools/cython/Cython/Includes/libcpp/string.pxd @@ -2,8 +2,8 @@ # deprecated cimport for backwards compatibility: from libc.string cimport const_char -cdef extern from "<string>" namespace "std::string" nogil: - const size_t npos +cdef extern from "<string>" namespace "std::string" nogil: + const size_t npos cdef extern from "<string>" namespace "std" nogil: cdef cppclass string: @@ -11,12 +11,12 @@ cdef extern from "<string>" namespace "std" nogil: cppclass iterator: iterator() char& operator*() - iterator(iterator&) + iterator(iterator&) iterator operator++() iterator operator--() bint operator==(iterator) bint operator!=(iterator) - + cppclass reverse_iterator: char& operator*() iterator operator++() @@ -29,22 +29,22 @@ cdef extern from "<string>" namespace "std" nogil: bint operator>(reverse_iterator) bint operator<=(reverse_iterator) bint operator>=(reverse_iterator) - + cppclass const_iterator(iterator): pass - + cppclass const_reverse_iterator(reverse_iterator): pass - string() except + - string(const string& s) except + - string(const string& s, size_t pos) except + - string(const string& s, size_t pos, size_t len) except + - string(const char* s) except + - string(const char* s, size_t n) except + - string(size_t n, char c) except + - string(iterator first, iterator last) except + - + string() except + + string(const string& s) except + + string(const string& s, size_t pos) except + + string(const string& s, size_t pos, size_t len) except + + string(const char* s) except + + string(const char* s, size_t n) except + + string(size_t n, char c) except + + string(iterator first, iterator last) except + + iterator begin() const_iterator const_begin "begin"() iterator end() @@ -59,123 +59,123 @@ cdef extern from "<string>" namespace "std" nogil: size_t size() size_t max_size() size_t length() - void resize(size_t) except + - void resize(size_t, char) except + - void shrink_to_fit() except + + void resize(size_t) except + + void resize(size_t, char) except + + void shrink_to_fit() except + size_t capacity() - void reserve(size_t) except + + void reserve(size_t) except + void clear() bint empty() - iterator erase(iterator first, iterator last) - iterator erase(iterator p) - iterator erase(const_iterator first, const_iterator last) - iterator erase(const_iterator p) - string& erase(size_t pos, size_t len) except + - string& erase(size_t pos) except + - string& erase() except + - - char& at(size_t pos) except + - char& operator[](size_t pos) - char& front() - char& back() - int compare(const string& s) - int compare(size_t pos, size_t len, const string& s) except + - int compare(size_t pos, size_t len, const string& s, size_t subpos, size_t sublen) except + - int compare(const char* s) except + - int compare(size_t pos, size_t len, const char* s) except + - int compare(size_t pos, size_t len, const char* s , size_t n) except + - - string& append(const string& s) except + - string& append(const string& s, size_t subpos, size_t sublen) except + - string& append(const char* s) except + - string& append(const char* s, size_t n) except + - string& append(size_t n, char c) except + - - void push_back(char c) except + - void pop_back() - - string& assign(const string& s) except + - string& assign(const string& s, size_t subpos, size_t sublen) except + - string& assign(const char* s, size_t n) except + - string& assign(const char* s) except + - string& assign(size_t n, char c) except + - - string& insert(size_t pos, const string& s, size_t subpos, size_t sublen) except + - string& insert(size_t pos, const string& s) except + - string& insert(size_t pos, const char* s, size_t n) except + - string& insert(size_t pos, const char* s) except + - string& insert(size_t pos, size_t n, char c) except + - void insert(iterator p, size_t n, char c) except + - iterator insert(iterator p, char c) except + - - size_t copy(char* s, size_t len, size_t pos) except + - size_t copy(char* s, size_t len) except + - - size_t find(const string& s, size_t pos) - size_t find(const string& s) - size_t find(const char* s, size_t pos, size_t n) - size_t find(const char* s, size_t pos) - size_t find(const char* s) - size_t find(char c, size_t pos) - size_t find(char c) - - size_t rfind(const string&, size_t pos) - size_t rfind(const string&) - size_t rfind(const char* s, size_t pos, size_t n) - size_t rfind(const char* s, size_t pos) - size_t rfind(const char* s) - size_t rfind(char c, size_t pos) + iterator erase(iterator first, iterator last) + iterator erase(iterator p) + iterator erase(const_iterator first, const_iterator last) + iterator erase(const_iterator p) + string& erase(size_t pos, size_t len) except + + string& erase(size_t pos) except + + string& erase() except + + + char& at(size_t pos) except + + char& operator[](size_t pos) + char& front() + char& back() + int compare(const string& s) + int compare(size_t pos, size_t len, const string& s) except + + int compare(size_t pos, size_t len, const string& s, size_t subpos, size_t sublen) except + + int compare(const char* s) except + + int compare(size_t pos, size_t len, const char* s) except + + int compare(size_t pos, size_t len, const char* s , size_t n) except + + + string& append(const string& s) except + + string& append(const string& s, size_t subpos, size_t sublen) except + + string& append(const char* s) except + + string& append(const char* s, size_t n) except + + string& append(size_t n, char c) except + + + void push_back(char c) except + + void pop_back() + + string& assign(const string& s) except + + string& assign(const string& s, size_t subpos, size_t sublen) except + + string& assign(const char* s, size_t n) except + + string& assign(const char* s) except + + string& assign(size_t n, char c) except + + + string& insert(size_t pos, const string& s, size_t subpos, size_t sublen) except + + string& insert(size_t pos, const string& s) except + + string& insert(size_t pos, const char* s, size_t n) except + + string& insert(size_t pos, const char* s) except + + string& insert(size_t pos, size_t n, char c) except + + void insert(iterator p, size_t n, char c) except + + iterator insert(iterator p, char c) except + + + size_t copy(char* s, size_t len, size_t pos) except + + size_t copy(char* s, size_t len) except + + + size_t find(const string& s, size_t pos) + size_t find(const string& s) + size_t find(const char* s, size_t pos, size_t n) + size_t find(const char* s, size_t pos) + size_t find(const char* s) + size_t find(char c, size_t pos) + size_t find(char c) + + size_t rfind(const string&, size_t pos) + size_t rfind(const string&) + size_t rfind(const char* s, size_t pos, size_t n) + size_t rfind(const char* s, size_t pos) + size_t rfind(const char* s) + size_t rfind(char c, size_t pos) size_t rfind(char c) - size_t find_first_of(const string&, size_t pos) - size_t find_first_of(const string&) - size_t find_first_of(const char* s, size_t pos, size_t n) - size_t find_first_of(const char* s, size_t pos) - size_t find_first_of(const char* s) - size_t find_first_of(char c, size_t pos) + size_t find_first_of(const string&, size_t pos) + size_t find_first_of(const string&) + size_t find_first_of(const char* s, size_t pos, size_t n) + size_t find_first_of(const char* s, size_t pos) + size_t find_first_of(const char* s) + size_t find_first_of(char c, size_t pos) size_t find_first_of(char c) - size_t find_first_not_of(const string& s, size_t pos) - size_t find_first_not_of(const string& s) - size_t find_first_not_of(const char* s, size_t pos, size_t n) - size_t find_first_not_of(const char* s, size_t pos) - size_t find_first_not_of(const char*) - size_t find_first_not_of(char c, size_t pos) + size_t find_first_not_of(const string& s, size_t pos) + size_t find_first_not_of(const string& s) + size_t find_first_not_of(const char* s, size_t pos, size_t n) + size_t find_first_not_of(const char* s, size_t pos) + size_t find_first_not_of(const char*) + size_t find_first_not_of(char c, size_t pos) size_t find_first_not_of(char c) - size_t find_last_of(const string& s, size_t pos) - size_t find_last_of(const string& s) - size_t find_last_of(const char* s, size_t pos, size_t n) - size_t find_last_of(const char* s, size_t pos) - size_t find_last_of(const char* s) - size_t find_last_of(char c, size_t pos) + size_t find_last_of(const string& s, size_t pos) + size_t find_last_of(const string& s) + size_t find_last_of(const char* s, size_t pos, size_t n) + size_t find_last_of(const char* s, size_t pos) + size_t find_last_of(const char* s) + size_t find_last_of(char c, size_t pos) size_t find_last_of(char c) - size_t find_last_not_of(const string& s, size_t pos) - size_t find_last_not_of(const string& s) - size_t find_last_not_of(const char* s, size_t pos, size_t n) - size_t find_last_not_of(const char* s, size_t pos) - size_t find_last_not_of(const char* s) - size_t find_last_not_of(char c, size_t pos) - size_t find_last_not_of(char c) + size_t find_last_not_of(const string& s, size_t pos) + size_t find_last_not_of(const string& s) + size_t find_last_not_of(const char* s, size_t pos, size_t n) + size_t find_last_not_of(const char* s, size_t pos) + size_t find_last_not_of(const char* s) + size_t find_last_not_of(char c, size_t pos) + size_t find_last_not_of(char c) - string substr(size_t pos, size_t len) except + - string substr(size_t pos) except + + string substr(size_t pos, size_t len) except + + string substr(size_t pos) except + string substr() #string& operator= (const string&) #string& operator= (const char*) #string& operator= (char) - string operator+ (const string&) except + - string operator+ (const char*) except + + string operator+ (const string&) except + + string operator+ (const char*) except + bint operator==(const string&) bint operator==(const char*) - bint operator!= (const string&) - bint operator!= (const char*) + bint operator!= (const string&) + bint operator!= (const char*) bint operator< (const string&) bint operator< (const char*) @@ -188,40 +188,40 @@ cdef extern from "<string>" namespace "std" nogil: bint operator>= (const string&) bint operator>= (const char*) - - - string to_string(int val) except + - string to_string(long val) except + - string to_string(long long val) except + - string to_string(unsigned val) except + - string to_string(size_t val) except + - string to_string(ssize_t val) except + - string to_string(unsigned long val) except + - string to_string(unsigned long long val) except + - string to_string(float val) except + - string to_string(double val) except + - string to_string(long double val) except + - - int stoi(const string& s, size_t* idx, int base) except + - int stoi(const string& s, size_t* idx) except + - int stoi(const string& s) except + - long stol(const string& s, size_t* idx, int base) except + - long stol(const string& s, size_t* idx) except + - long stol(const string& s) except + - long long stoll(const string& s, size_t* idx, int base) except + - long long stoll(const string& s, size_t* idx) except + - long long stoll(const string& s) except + - - unsigned long stoul(const string& s, size_t* idx, int base) except + - unsigned long stoul(const string& s, size_t* idx) except + - unsigned long stoul(const string& s) except + - unsigned long long stoull(const string& s, size_t* idx, int base) except + - unsigned long long stoull(const string& s, size_t* idx) except + - unsigned long long stoull(const string& s) except + - - float stof(const string& s, size_t* idx) except + - float stof(const string& s) except + - double stod(const string& s, size_t* idx) except + - double stod(const string& s) except + - long double stold(const string& s, size_t* idx) except + - long double stold(const string& s) except + + + + string to_string(int val) except + + string to_string(long val) except + + string to_string(long long val) except + + string to_string(unsigned val) except + + string to_string(size_t val) except + + string to_string(ssize_t val) except + + string to_string(unsigned long val) except + + string to_string(unsigned long long val) except + + string to_string(float val) except + + string to_string(double val) except + + string to_string(long double val) except + + + int stoi(const string& s, size_t* idx, int base) except + + int stoi(const string& s, size_t* idx) except + + int stoi(const string& s) except + + long stol(const string& s, size_t* idx, int base) except + + long stol(const string& s, size_t* idx) except + + long stol(const string& s) except + + long long stoll(const string& s, size_t* idx, int base) except + + long long stoll(const string& s, size_t* idx) except + + long long stoll(const string& s) except + + + unsigned long stoul(const string& s, size_t* idx, int base) except + + unsigned long stoul(const string& s, size_t* idx) except + + unsigned long stoul(const string& s) except + + unsigned long long stoull(const string& s, size_t* idx, int base) except + + unsigned long long stoull(const string& s, size_t* idx) except + + unsigned long long stoull(const string& s) except + + + float stof(const string& s, size_t* idx) except + + float stof(const string& s) except + + double stod(const string& s, size_t* idx) except + + double stod(const string& s) except + + long double stold(const string& s, size_t* idx) except + + long double stold(const string& s) except + diff --git a/contrib/tools/cython/Cython/Includes/libcpp/unordered_map.pxd b/contrib/tools/cython/Cython/Includes/libcpp/unordered_map.pxd index 6b1e3793e7..a00fbbed28 100644 --- a/contrib/tools/cython/Cython/Includes/libcpp/unordered_map.pxd +++ b/contrib/tools/cython/Cython/Includes/libcpp/unordered_map.pxd @@ -1,7 +1,7 @@ from .utility cimport pair cdef extern from "<unordered_map>" namespace "std" nogil: - cdef cppclass unordered_map[T, U, HASH=*, PRED=*, ALLOCATOR=*]: + cdef cppclass unordered_map[T, U, HASH=*, PRED=*, ALLOCATOR=*]: ctypedef T key_type ctypedef U mapped_type ctypedef pair[const T, U] value_type diff --git a/contrib/tools/cython/Cython/Includes/libcpp/utility.pxd b/contrib/tools/cython/Cython/Includes/libcpp/utility.pxd index 3dc02e9380..e0df69b166 100644 --- a/contrib/tools/cython/Cython/Includes/libcpp/utility.pxd +++ b/contrib/tools/cython/Cython/Includes/libcpp/utility.pxd @@ -13,18 +13,18 @@ cdef extern from "<utility>" namespace "std" nogil: bint operator>(pair&, pair&) bint operator<=(pair&, pair&) bint operator>=(pair&, pair&) - -cdef extern from * namespace "cython_std" nogil: - """ - #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600) - // move should be defined for these versions of MSVC, but __cplusplus isn't set usefully - #include <type_traits> - - namespace cython_std { - template <typename T> typename std::remove_reference<T>::type&& move(T& t) noexcept { return std::move(t); } - template <typename T> typename std::remove_reference<T>::type&& move(T&& t) noexcept { return std::move(t); } - } - - #endif - """ - cdef T move[T](T) + +cdef extern from * namespace "cython_std" nogil: + """ + #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600) + // move should be defined for these versions of MSVC, but __cplusplus isn't set usefully + #include <type_traits> + + namespace cython_std { + template <typename T> typename std::remove_reference<T>::type&& move(T& t) noexcept { return std::move(t); } + template <typename T> typename std::remove_reference<T>::type&& move(T&& t) noexcept { return std::move(t); } + } + + #endif + """ + cdef T move[T](T) diff --git a/contrib/tools/cython/Cython/Includes/numpy/__init__.pxd b/contrib/tools/cython/Cython/Includes/numpy/__init__.pxd index 4231e6cbd4..15700c05ef 100644 --- a/contrib/tools/cython/Cython/Includes/numpy/__init__.pxd +++ b/contrib/tools/cython/Cython/Includes/numpy/__init__.pxd @@ -226,11 +226,11 @@ cdef extern from "numpy/arrayobject.h": # this field via the inline helper method PyDataType_SHAPE. cdef PyArray_ArrayDescr* subarray - ctypedef class numpy.flatiter [object PyArrayIterObject, check_size ignore]: + ctypedef class numpy.flatiter [object PyArrayIterObject, check_size ignore]: # Use through macros pass - ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]: + ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]: # Use through macros pass @@ -685,7 +685,7 @@ cdef extern from "numpy/arrayobject.h": object PyArray_Choose (ndarray, object, ndarray, NPY_CLIPMODE) int PyArray_Sort (ndarray, int, NPY_SORTKIND) object PyArray_ArgSort (ndarray, int, NPY_SORTKIND) - object PyArray_SearchSorted (ndarray, object, NPY_SEARCHSIDE, PyObject*) + object PyArray_SearchSorted (ndarray, object, NPY_SEARCHSIDE, PyObject*) object PyArray_ArgMax (ndarray, int, ndarray) object PyArray_ArgMin (ndarray, int, ndarray) object PyArray_Reshape (ndarray, object) @@ -914,7 +914,7 @@ cdef extern from "numpy/ufuncobject.h": ctypedef void (*PyUFuncGenericFunction) (char **, npy_intp *, npy_intp *, void *) - ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]: + ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]: cdef: int nin, nout, nargs int identity diff --git a/contrib/tools/cython/Cython/Includes/posix/fcntl.pxd b/contrib/tools/cython/Cython/Includes/posix/fcntl.pxd index fe9fc5daf4..9afc33a368 100644 --- a/contrib/tools/cython/Cython/Includes/posix/fcntl.pxd +++ b/contrib/tools/cython/Cython/Includes/posix/fcntl.pxd @@ -24,7 +24,7 @@ cdef extern from "<fcntl.h>" nogil: enum: SEEK_END enum: O_CREAT - enum: O_DIRECT + enum: O_DIRECT enum: O_EXCL enum: O_NOCTTY enum: O_TRUNC |