mirror of
https://github.com/python/cpython.git
synced 2025-08-16 06:40:56 +00:00
Issue #4129: Belatedly document which C API functions had their argument(s) or
return type changed from int or int * to Py_ssize_t or Py_ssize_t * as this might cause problems on 64-bit platforms.
This commit is contained in:
parent
e09f161618
commit
089c5cdd09
13 changed files with 171 additions and 5 deletions
|
@ -11,6 +11,10 @@ Allocating Objects on the Heap
|
||||||
|
|
||||||
.. cfunction:: PyVarObject* _PyObject_NewVar(PyTypeObject *type, Py_ssize_t size)
|
.. cfunction:: PyVarObject* _PyObject_NewVar(PyTypeObject *type, Py_ssize_t size)
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *size*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: void _PyObject_Del(PyObject *op)
|
.. cfunction:: void _PyObject_Del(PyObject *op)
|
||||||
|
|
||||||
|
|
|
@ -403,6 +403,10 @@ and the following format units are left untouched.
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
.. versionadded:: 2.2
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *min* and *max*. This might
|
||||||
|
require changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: PyObject* Py_BuildValue(const char *format, ...)
|
.. cfunction:: PyObject* Py_BuildValue(const char *format, ...)
|
||||||
|
|
||||||
|
|
|
@ -376,6 +376,11 @@ could be used to pass around structured data in its native, in-memory format.
|
||||||
then the new buffer's contents extend to the length of the *base* object's
|
then the new buffer's contents extend to the length of the *base* object's
|
||||||
exported buffer data.
|
exported buffer data.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *offset* and *size*. This
|
||||||
|
might require changes in your code for properly supporting 64-bit
|
||||||
|
systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: PyObject* PyBuffer_FromReadWriteObject(PyObject *base, Py_ssize_t offset, Py_ssize_t size)
|
.. cfunction:: PyObject* PyBuffer_FromReadWriteObject(PyObject *base, Py_ssize_t offset, Py_ssize_t size)
|
||||||
|
|
||||||
|
@ -383,6 +388,11 @@ could be used to pass around structured data in its native, in-memory format.
|
||||||
those for :cfunc:`PyBuffer_FromObject`. If the *base* object does not export
|
those for :cfunc:`PyBuffer_FromObject`. If the *base* object does not export
|
||||||
the writeable buffer protocol, then :exc:`TypeError` is raised.
|
the writeable buffer protocol, then :exc:`TypeError` is raised.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *offset* and *size*. This
|
||||||
|
might require changes in your code for properly supporting 64-bit
|
||||||
|
systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: PyObject* PyBuffer_FromMemory(void *ptr, Py_ssize_t size)
|
.. cfunction:: PyObject* PyBuffer_FromMemory(void *ptr, Py_ssize_t size)
|
||||||
|
|
||||||
|
@ -393,11 +403,19 @@ could be used to pass around structured data in its native, in-memory format.
|
||||||
:const:`Py_END_OF_BUFFER` may *not* be passed for the *size* parameter;
|
:const:`Py_END_OF_BUFFER` may *not* be passed for the *size* parameter;
|
||||||
:exc:`ValueError` will be raised in that case.
|
:exc:`ValueError` will be raised in that case.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *size*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: PyObject* PyBuffer_FromReadWriteMemory(void *ptr, Py_ssize_t size)
|
.. cfunction:: PyObject* PyBuffer_FromReadWriteMemory(void *ptr, Py_ssize_t size)
|
||||||
|
|
||||||
Similar to :cfunc:`PyBuffer_FromMemory`, but the returned buffer is writable.
|
Similar to :cfunc:`PyBuffer_FromMemory`, but the returned buffer is writable.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *size*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: PyObject* PyBuffer_New(Py_ssize_t size)
|
.. cfunction:: PyObject* PyBuffer_New(Py_ssize_t size)
|
||||||
|
|
||||||
|
@ -405,3 +423,7 @@ could be used to pass around structured data in its native, in-memory format.
|
||||||
*size* bytes. :exc:`ValueError` is returned if *size* is not zero or positive.
|
*size* bytes. :exc:`ValueError` is returned if *size* is not zero or positive.
|
||||||
Note that the memory buffer (as returned by :cfunc:`PyObject_AsWriteBuffer`) is
|
Note that the memory buffer (as returned by :cfunc:`PyObject_AsWriteBuffer`) is
|
||||||
not specifically aligned.
|
not specifically aligned.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *size*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
|
@ -143,6 +143,10 @@ Dictionary Objects
|
||||||
Return the number of items in the dictionary. This is equivalent to
|
Return the number of items in the dictionary. This is equivalent to
|
||||||
``len(p)`` on a dictionary.
|
``len(p)`` on a dictionary.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function returned an :ctype:`int` type. This might require changes
|
||||||
|
in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: int PyDict_Next(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue)
|
.. cfunction:: int PyDict_Next(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue)
|
||||||
|
|
||||||
|
@ -187,6 +191,10 @@ Dictionary Objects
|
||||||
Py_DECREF(o);
|
Py_DECREF(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int *` type for *ppos*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: int PyDict_Merge(PyObject *a, PyObject *b, int override)
|
.. cfunction:: int PyDict_Merge(PyObject *a, PyObject *b, int override)
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,10 @@ List Objects
|
||||||
:cfunc:`PySequence_SetItem` or expose the object to Python code before setting
|
:cfunc:`PySequence_SetItem` or expose the object to Python code before setting
|
||||||
all items to a real object with :cfunc:`PyList_SetItem`.
|
all items to a real object with :cfunc:`PyList_SetItem`.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` for *size*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: Py_ssize_t PyList_Size(PyObject *list)
|
.. cfunction:: Py_ssize_t PyList_Size(PyObject *list)
|
||||||
|
|
||||||
|
@ -57,6 +61,10 @@ List Objects
|
||||||
Return the length of the list object in *list*; this is equivalent to
|
Return the length of the list object in *list*; this is equivalent to
|
||||||
``len(list)`` on a list object.
|
``len(list)`` on a list object.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function returned an :ctype:`int`. This might require changes in
|
||||||
|
your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: Py_ssize_t PyList_GET_SIZE(PyObject *list)
|
.. cfunction:: Py_ssize_t PyList_GET_SIZE(PyObject *list)
|
||||||
|
|
||||||
|
@ -69,6 +77,10 @@ List Objects
|
||||||
must be positive, indexing from the end of the list is not supported. If *pos*
|
must be positive, indexing from the end of the list is not supported. If *pos*
|
||||||
is out of bounds, return *NULL* and set an :exc:`IndexError` exception.
|
is out of bounds, return *NULL* and set an :exc:`IndexError` exception.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` for *index*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: PyObject* PyList_GET_ITEM(PyObject *list, Py_ssize_t i)
|
.. cfunction:: PyObject* PyList_GET_ITEM(PyObject *list, Py_ssize_t i)
|
||||||
|
|
||||||
|
@ -85,6 +97,10 @@ List Objects
|
||||||
This function "steals" a reference to *item* and discards a reference to an item
|
This function "steals" a reference to *item* and discards a reference to an item
|
||||||
already in the list at the affected position.
|
already in the list at the affected position.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` for *index*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: void PyList_SET_ITEM(PyObject *list, Py_ssize_t i, PyObject *o)
|
.. cfunction:: void PyList_SET_ITEM(PyObject *list, Py_ssize_t i, PyObject *o)
|
||||||
|
|
||||||
|
@ -104,6 +120,10 @@ List Objects
|
||||||
if successful; return ``-1`` and set an exception if unsuccessful. Analogous to
|
if successful; return ``-1`` and set an exception if unsuccessful. Analogous to
|
||||||
``list.insert(index, item)``.
|
``list.insert(index, item)``.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` for *index*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: int PyList_Append(PyObject *list, PyObject *item)
|
.. cfunction:: int PyList_Append(PyObject *list, PyObject *item)
|
||||||
|
|
||||||
|
@ -118,6 +138,10 @@ List Objects
|
||||||
and *high*. Return *NULL* and set an exception if unsuccessful. Analogous to
|
and *high*. Return *NULL* and set an exception if unsuccessful. Analogous to
|
||||||
``list[low:high]``.
|
``list[low:high]``.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` for *low* and *high*. This might
|
||||||
|
require changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: int PyList_SetSlice(PyObject *list, Py_ssize_t low, Py_ssize_t high, PyObject *itemlist)
|
.. cfunction:: int PyList_SetSlice(PyObject *list, Py_ssize_t low, Py_ssize_t high, PyObject *itemlist)
|
||||||
|
|
||||||
|
@ -126,6 +150,10 @@ List Objects
|
||||||
indicating the assignment of an empty list (slice deletion). Return ``0`` on
|
indicating the assignment of an empty list (slice deletion). Return ``0`` on
|
||||||
success, ``-1`` on failure.
|
success, ``-1`` on failure.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` for *low* and *high*. This might
|
||||||
|
require changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: int PyList_Sort(PyObject *list)
|
.. cfunction:: int PyList_Sort(PyObject *list)
|
||||||
|
|
||||||
|
|
|
@ -106,6 +106,10 @@ Long Integer Objects
|
||||||
|
|
||||||
.. versionadded:: 1.6
|
.. versionadded:: 1.6
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` for *length*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: PyObject* PyLong_FromVoidPtr(void *p)
|
.. cfunction:: PyObject* PyLong_FromVoidPtr(void *p)
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,8 @@ Mapping Protocol
|
||||||
function always succeeds.
|
function always succeeds.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: Py_ssize_t PyMapping_Length(PyObject *o)
|
.. cfunction:: Py_ssize_t PyMapping_Size(PyObject *o)
|
||||||
|
Py_ssize_t PyMapping_Length(PyObject *o)
|
||||||
|
|
||||||
.. index:: builtin: len
|
.. index:: builtin: len
|
||||||
|
|
||||||
|
@ -20,6 +21,10 @@ Mapping Protocol
|
||||||
objects that do not provide mapping protocol, this is equivalent to the Python
|
objects that do not provide mapping protocol, this is equivalent to the Python
|
||||||
expression ``len(o)``.
|
expression ``len(o)``.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
These functions returned an :ctype:`int` type. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: int PyMapping_DelItemString(PyObject *o, char *key)
|
.. cfunction:: int PyMapping_DelItemString(PyObject *o, char *key)
|
||||||
|
|
||||||
|
|
|
@ -351,6 +351,10 @@ is considered sufficient for this determination.
|
||||||
and mapping protocols, the sequence length is returned. On error, ``-1`` is
|
and mapping protocols, the sequence length is returned. On error, ``-1`` is
|
||||||
returned. This is the equivalent to the Python expression ``len(o)``.
|
returned. This is the equivalent to the Python expression ``len(o)``.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
These functions returned an :ctype:`int` type. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: PyObject* PyObject_GetItem(PyObject *o, PyObject *key)
|
.. cfunction:: PyObject* PyObject_GetItem(PyObject *o, PyObject *key)
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ Sequence Protocol
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: Py_ssize_t PySequence_Size(PyObject *o)
|
.. cfunction:: Py_ssize_t PySequence_Size(PyObject *o)
|
||||||
|
Py_ssize_t PySequence_Length(PyObject *o)
|
||||||
|
|
||||||
.. index:: builtin: len
|
.. index:: builtin: len
|
||||||
|
|
||||||
|
@ -20,10 +21,9 @@ Sequence Protocol
|
||||||
For objects that do not provide sequence protocol, this is equivalent to the
|
For objects that do not provide sequence protocol, this is equivalent to the
|
||||||
Python expression ``len(o)``.
|
Python expression ``len(o)``.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
.. cfunction:: Py_ssize_t PySequence_Length(PyObject *o)
|
These functions returned an :ctype:`int` type. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
Alternate name for :cfunc:`PySequence_Size`.
|
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: PyObject* PySequence_Concat(PyObject *o1, PyObject *o2)
|
.. cfunction:: PyObject* PySequence_Concat(PyObject *o1, PyObject *o2)
|
||||||
|
@ -37,6 +37,10 @@ Sequence Protocol
|
||||||
Return the result of repeating sequence object *o* *count* times, or *NULL* on
|
Return the result of repeating sequence object *o* *count* times, or *NULL* on
|
||||||
failure. This is the equivalent of the Python expression ``o * count``.
|
failure. This is the equivalent of the Python expression ``o * count``.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *count*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: PyObject* PySequence_InPlaceConcat(PyObject *o1, PyObject *o2)
|
.. cfunction:: PyObject* PySequence_InPlaceConcat(PyObject *o1, PyObject *o2)
|
||||||
|
|
||||||
|
@ -51,18 +55,30 @@ Sequence Protocol
|
||||||
failure. The operation is done *in-place* when *o* supports it. This is the
|
failure. The operation is done *in-place* when *o* supports it. This is the
|
||||||
equivalent of the Python expression ``o *= count``.
|
equivalent of the Python expression ``o *= count``.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *count*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: PyObject* PySequence_GetItem(PyObject *o, Py_ssize_t i)
|
.. cfunction:: PyObject* PySequence_GetItem(PyObject *o, Py_ssize_t i)
|
||||||
|
|
||||||
Return the *i*th element of *o*, or *NULL* on failure. This is the equivalent of
|
Return the *i*th element of *o*, or *NULL* on failure. This is the equivalent of
|
||||||
the Python expression ``o[i]``.
|
the Python expression ``o[i]``.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *i*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: PyObject* PySequence_GetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2)
|
.. cfunction:: PyObject* PySequence_GetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2)
|
||||||
|
|
||||||
Return the slice of sequence object *o* between *i1* and *i2*, or *NULL* on
|
Return the slice of sequence object *o* between *i1* and *i2*, or *NULL* on
|
||||||
failure. This is the equivalent of the Python expression ``o[i1:i2]``.
|
failure. This is the equivalent of the Python expression ``o[i1:i2]``.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *i1* and *i2*. This might
|
||||||
|
require changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: int PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v)
|
.. cfunction:: int PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v)
|
||||||
|
|
||||||
|
@ -70,24 +86,40 @@ Sequence Protocol
|
||||||
is the equivalent of the Python statement ``o[i] = v``. This function *does
|
is the equivalent of the Python statement ``o[i] = v``. This function *does
|
||||||
not* steal a reference to *v*.
|
not* steal a reference to *v*.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *i*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: int PySequence_DelItem(PyObject *o, Py_ssize_t i)
|
.. cfunction:: int PySequence_DelItem(PyObject *o, Py_ssize_t i)
|
||||||
|
|
||||||
Delete the *i*th element of object *o*. Returns ``-1`` on failure. This is the
|
Delete the *i*th element of object *o*. Returns ``-1`` on failure. This is the
|
||||||
equivalent of the Python statement ``del o[i]``.
|
equivalent of the Python statement ``del o[i]``.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *i*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: int PySequence_SetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2, PyObject *v)
|
.. cfunction:: int PySequence_SetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2, PyObject *v)
|
||||||
|
|
||||||
Assign the sequence object *v* to the slice in sequence object *o* from *i1* to
|
Assign the sequence object *v* to the slice in sequence object *o* from *i1* to
|
||||||
*i2*. This is the equivalent of the Python statement ``o[i1:i2] = v``.
|
*i2*. This is the equivalent of the Python statement ``o[i1:i2] = v``.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *i1* and *i2*. This might
|
||||||
|
require changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: int PySequence_DelSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2)
|
.. cfunction:: int PySequence_DelSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2)
|
||||||
|
|
||||||
Delete the slice in sequence object *o* from *i1* to *i2*. Returns ``-1`` on
|
Delete the slice in sequence object *o* from *i1* to *i2*. Returns ``-1`` on
|
||||||
failure. This is the equivalent of the Python statement ``del o[i1:i2]``.
|
failure. This is the equivalent of the Python statement ``del o[i1:i2]``.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *i1* and *i2*. This might
|
||||||
|
require changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: Py_ssize_t PySequence_Count(PyObject *o, PyObject *value)
|
.. cfunction:: Py_ssize_t PySequence_Count(PyObject *o, PyObject *value)
|
||||||
|
|
||||||
|
@ -95,6 +127,10 @@ Sequence Protocol
|
||||||
of keys for which ``o[key] == value``. On failure, return ``-1``. This is
|
of keys for which ``o[key] == value``. On failure, return ``-1``. This is
|
||||||
equivalent to the Python expression ``o.count(value)``.
|
equivalent to the Python expression ``o.count(value)``.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function returned an :ctype:`int` type. This might require changes
|
||||||
|
in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: int PySequence_Contains(PyObject *o, PyObject *value)
|
.. cfunction:: int PySequence_Contains(PyObject *o, PyObject *value)
|
||||||
|
|
||||||
|
@ -108,6 +144,10 @@ Sequence Protocol
|
||||||
Return the first index *i* for which ``o[i] == value``. On error, return
|
Return the first index *i* for which ``o[i] == value``. On error, return
|
||||||
``-1``. This is equivalent to the Python expression ``o.index(value)``.
|
``-1``. This is equivalent to the Python expression ``o.index(value)``.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function returned an :ctype:`int` type. This might require changes
|
||||||
|
in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: PyObject* PySequence_List(PyObject *o)
|
.. cfunction:: PyObject* PySequence_List(PyObject *o)
|
||||||
|
|
||||||
|
|
|
@ -116,6 +116,10 @@ or :class:`frozenset` or instances of their subtypes.
|
||||||
``len(anyset)``. Raises a :exc:`PyExc_SystemError` if *anyset* is not a
|
``len(anyset)``. Raises a :exc:`PyExc_SystemError` if *anyset* is not a
|
||||||
:class:`set`, :class:`frozenset`, or an instance of a subtype.
|
:class:`set`, :class:`frozenset`, or an instance of a subtype.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function returned an :ctype:`int`. This might require changes in
|
||||||
|
your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: Py_ssize_t PySet_GET_SIZE(PyObject *anyset)
|
.. cfunction:: Py_ssize_t PySet_GET_SIZE(PyObject *anyset)
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,10 @@ called with a non-string parameter.
|
||||||
*len* on success, and *NULL* on failure. If *v* is *NULL*, the contents of the
|
*len* on success, and *NULL* on failure. If *v* is *NULL*, the contents of the
|
||||||
string are uninitialized.
|
string are uninitialized.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *len*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: PyObject* PyString_FromFormat(const char *format, ...)
|
.. cfunction:: PyObject* PyString_FromFormat(const char *format, ...)
|
||||||
|
|
||||||
|
@ -134,6 +138,10 @@ called with a non-string parameter.
|
||||||
|
|
||||||
Return the length of the string in string object *string*.
|
Return the length of the string in string object *string*.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function returned an :ctype:`int` type. This might require changes
|
||||||
|
in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: Py_ssize_t PyString_GET_SIZE(PyObject *string)
|
.. cfunction:: Py_ssize_t PyString_GET_SIZE(PyObject *string)
|
||||||
|
|
||||||
|
@ -202,6 +210,9 @@ called with a non-string parameter.
|
||||||
fails, the original string object at *\*string* is deallocated, *\*string* is
|
fails, the original string object at *\*string* is deallocated, *\*string* is
|
||||||
set to *NULL*, a memory exception is set, and ``-1`` is returned.
|
set to *NULL*, a memory exception is set, and ``-1`` is returned.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *newsize*. This might
|
||||||
|
require changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
.. cfunction:: PyObject* PyString_Format(PyObject *format, PyObject *args)
|
.. cfunction:: PyObject* PyString_Format(PyObject *format, PyObject *args)
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,10 @@ Tuple Objects
|
||||||
|
|
||||||
Return a new tuple object of size *len*, or *NULL* on failure.
|
Return a new tuple object of size *len*, or *NULL* on failure.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *len*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: PyObject* PyTuple_Pack(Py_ssize_t n, ...)
|
.. cfunction:: PyObject* PyTuple_Pack(Py_ssize_t n, ...)
|
||||||
|
|
||||||
|
@ -51,11 +55,19 @@ Tuple Objects
|
||||||
|
|
||||||
.. versionadded:: 2.4
|
.. versionadded:: 2.4
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *n*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: Py_ssize_t PyTuple_Size(PyObject *p)
|
.. cfunction:: Py_ssize_t PyTuple_Size(PyObject *p)
|
||||||
|
|
||||||
Take a pointer to a tuple object, and return the size of that tuple.
|
Take a pointer to a tuple object, and return the size of that tuple.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function returned an :ctype:`int` type. This might require changes
|
||||||
|
in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: Py_ssize_t PyTuple_GET_SIZE(PyObject *p)
|
.. cfunction:: Py_ssize_t PyTuple_GET_SIZE(PyObject *p)
|
||||||
|
|
||||||
|
@ -68,6 +80,10 @@ Tuple Objects
|
||||||
Return the object at position *pos* in the tuple pointed to by *p*. If *pos* is
|
Return the object at position *pos* in the tuple pointed to by *p*. If *pos* is
|
||||||
out of bounds, return *NULL* and sets an :exc:`IndexError` exception.
|
out of bounds, return *NULL* and sets an :exc:`IndexError` exception.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *pos*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: PyObject* PyTuple_GET_ITEM(PyObject *p, Py_ssize_t pos)
|
.. cfunction:: PyObject* PyTuple_GET_ITEM(PyObject *p, Py_ssize_t pos)
|
||||||
|
|
||||||
|
@ -79,6 +95,10 @@ Tuple Objects
|
||||||
Take a slice of the tuple pointed to by *p* from *low* to *high* and return it
|
Take a slice of the tuple pointed to by *p* from *low* to *high* and return it
|
||||||
as a new tuple.
|
as a new tuple.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *low* and *high*. This might
|
||||||
|
require changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: int PyTuple_SetItem(PyObject *p, Py_ssize_t pos, PyObject *o)
|
.. cfunction:: int PyTuple_SetItem(PyObject *p, Py_ssize_t pos, PyObject *o)
|
||||||
|
|
||||||
|
@ -89,6 +109,10 @@ Tuple Objects
|
||||||
|
|
||||||
This function "steals" a reference to *o*.
|
This function "steals" a reference to *o*.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *pos*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: void PyTuple_SET_ITEM(PyObject *p, Py_ssize_t pos, PyObject *o)
|
.. cfunction:: void PyTuple_SET_ITEM(PyObject *p, Py_ssize_t pos, PyObject *o)
|
||||||
|
|
||||||
|
@ -116,6 +140,10 @@ Tuple Objects
|
||||||
.. versionchanged:: 2.2
|
.. versionchanged:: 2.2
|
||||||
Removed unused third parameter, *last_is_sticky*.
|
Removed unused third parameter, *last_is_sticky*.
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *newsize*. This might
|
||||||
|
require changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: int PyTuple_ClearFreeList(void)
|
.. cfunction:: int PyTuple_ClearFreeList(void)
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,10 @@ Type Objects
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
.. versionadded:: 2.2
|
||||||
|
|
||||||
|
.. versionchanged:: 2.5
|
||||||
|
This function used an :ctype:`int` type for *nitems*. This might require
|
||||||
|
changes in your code for properly supporting 64-bit systems.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: PyObject* PyType_GenericNew(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
.. cfunction:: PyObject* PyType_GenericNew(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue