[Python-checkins] r71910 - in python/trunk/Doc/c-api: allocation.rst arg.rst buffer.rst dict.rst list.rst long.rst mapping.rst object.rst sequence.rst set.rst string.rst tuple.rst type.rst

jeroen.ruigrok python-checkins at python.org
Sat Apr 25 19:59:04 CEST 2009


Author: jeroen.ruigrok
Date: Sat Apr 25 19:59:03 2009
New Revision: 71910

Log:
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.


Modified:
   python/trunk/Doc/c-api/allocation.rst
   python/trunk/Doc/c-api/arg.rst
   python/trunk/Doc/c-api/buffer.rst
   python/trunk/Doc/c-api/dict.rst
   python/trunk/Doc/c-api/list.rst
   python/trunk/Doc/c-api/long.rst
   python/trunk/Doc/c-api/mapping.rst
   python/trunk/Doc/c-api/object.rst
   python/trunk/Doc/c-api/sequence.rst
   python/trunk/Doc/c-api/set.rst
   python/trunk/Doc/c-api/string.rst
   python/trunk/Doc/c-api/tuple.rst
   python/trunk/Doc/c-api/type.rst

Modified: python/trunk/Doc/c-api/allocation.rst
==============================================================================
--- python/trunk/Doc/c-api/allocation.rst	(original)
+++ python/trunk/Doc/c-api/allocation.rst	Sat Apr 25 19:59:03 2009
@@ -11,6 +11,10 @@
 
 .. 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)
 

Modified: python/trunk/Doc/c-api/arg.rst
==============================================================================
--- python/trunk/Doc/c-api/arg.rst	(original)
+++ python/trunk/Doc/c-api/arg.rst	Sat Apr 25 19:59:03 2009
@@ -403,6 +403,10 @@
 
    .. 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, ...)
 

Modified: python/trunk/Doc/c-api/buffer.rst
==============================================================================
--- python/trunk/Doc/c-api/buffer.rst	(original)
+++ python/trunk/Doc/c-api/buffer.rst	Sat Apr 25 19:59:03 2009
@@ -376,6 +376,11 @@
    then the new buffer's contents extend to the length of the *base* object's
    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)
 
@@ -383,6 +388,11 @@
    those for :cfunc:`PyBuffer_FromObject`.  If the *base* object does not export
    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)
 
@@ -393,11 +403,19 @@
    :const:`Py_END_OF_BUFFER` may *not* be passed for the *size* parameter;
    :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)
 
    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)
 
@@ -405,3 +423,7 @@
    *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
    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.

Modified: python/trunk/Doc/c-api/dict.rst
==============================================================================
--- python/trunk/Doc/c-api/dict.rst	(original)
+++ python/trunk/Doc/c-api/dict.rst	Sat Apr 25 19:59:03 2009
@@ -143,6 +143,10 @@
    Return the number of items in the dictionary.  This is equivalent to
    ``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)
 
@@ -187,6 +191,10 @@
           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)
 

Modified: python/trunk/Doc/c-api/list.rst
==============================================================================
--- python/trunk/Doc/c-api/list.rst	(original)
+++ python/trunk/Doc/c-api/list.rst	Sat Apr 25 19:59:03 2009
@@ -49,6 +49,10 @@
       :cfunc:`PySequence_SetItem`  or expose the object to Python code before setting
       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)
 
@@ -57,6 +61,10 @@
    Return the length of the list object in *list*; this is equivalent to
    ``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)
 
@@ -69,6 +77,10 @@
    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.
 
+   .. 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)
 
@@ -85,6 +97,10 @@
       This function "steals" a reference to *item* and discards a reference to an item
       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)
 
@@ -104,6 +120,10 @@
    if successful; return ``-1`` and set an exception if unsuccessful.  Analogous to
    ``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)
 
@@ -118,6 +138,10 @@
    and *high*.  Return *NULL* and set an exception if unsuccessful. Analogous to
    ``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)
 
@@ -126,6 +150,10 @@
    indicating the assignment of an empty list (slice deletion). Return ``0`` on
    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)
 

Modified: python/trunk/Doc/c-api/long.rst
==============================================================================
--- python/trunk/Doc/c-api/long.rst	(original)
+++ python/trunk/Doc/c-api/long.rst	Sat Apr 25 19:59:03 2009
@@ -106,6 +106,10 @@
 
    .. 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)
 

Modified: python/trunk/Doc/c-api/mapping.rst
==============================================================================
--- python/trunk/Doc/c-api/mapping.rst	(original)
+++ python/trunk/Doc/c-api/mapping.rst	Sat Apr 25 19:59:03 2009
@@ -12,7 +12,8 @@
    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
 
@@ -20,6 +21,10 @@
    objects that do not provide mapping protocol, this is 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:: int PyMapping_DelItemString(PyObject *o, char *key)
 

Modified: python/trunk/Doc/c-api/object.rst
==============================================================================
--- python/trunk/Doc/c-api/object.rst	(original)
+++ python/trunk/Doc/c-api/object.rst	Sat Apr 25 19:59:03 2009
@@ -351,6 +351,10 @@
    and mapping protocols, the sequence length is returned.  On error, ``-1`` is
    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)
 

Modified: python/trunk/Doc/c-api/sequence.rst
==============================================================================
--- python/trunk/Doc/c-api/sequence.rst	(original)
+++ python/trunk/Doc/c-api/sequence.rst	Sat Apr 25 19:59:03 2009
@@ -13,6 +13,7 @@
 
 
 .. cfunction:: Py_ssize_t PySequence_Size(PyObject *o)
+               Py_ssize_t PySequence_Length(PyObject *o)
 
    .. index:: builtin: len
 
@@ -20,10 +21,9 @@
    For objects that do not provide sequence protocol, this is equivalent to the
    Python expression ``len(o)``.
 
-
-.. cfunction:: Py_ssize_t PySequence_Length(PyObject *o)
-
-   Alternate name for :cfunc:`PySequence_Size`.
+   .. 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* PySequence_Concat(PyObject *o1, PyObject *o2)
@@ -37,6 +37,10 @@
    Return the result of repeating sequence object *o* *count* times, or *NULL* on
    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)
 
@@ -51,18 +55,30 @@
    failure.  The operation is done *in-place* when *o* supports it.  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_GetItem(PyObject *o, Py_ssize_t i)
 
    Return the *i*th element of *o*, or *NULL* on failure. This is the equivalent of
    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)
 
    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]``.
 
+   .. 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)
 
@@ -70,24 +86,40 @@
    is the equivalent of the Python statement ``o[i] = v``.  This function *does
    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)
 
    Delete the *i*th element of object *o*.  Returns ``-1`` on failure.  This is the
    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)
 
    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``.
 
+   .. 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)
 
    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]``.
 
+   .. 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)
 
@@ -95,6 +127,10 @@
    of keys for which ``o[key] == value``.  On failure, return ``-1``.  This is
    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)
 
@@ -108,6 +144,10 @@
    Return the first index *i* for which ``o[i] == value``.  On error, return
    ``-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)
 

Modified: python/trunk/Doc/c-api/set.rst
==============================================================================
--- python/trunk/Doc/c-api/set.rst	(original)
+++ python/trunk/Doc/c-api/set.rst	Sat Apr 25 19:59:03 2009
@@ -116,6 +116,10 @@
    ``len(anyset)``.  Raises a :exc:`PyExc_SystemError` if *anyset* is not a
    :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)
 

Modified: python/trunk/Doc/c-api/string.rst
==============================================================================
--- python/trunk/Doc/c-api/string.rst	(original)
+++ python/trunk/Doc/c-api/string.rst	Sat Apr 25 19:59:03 2009
@@ -60,6 +60,10 @@
    *len* on success, and *NULL* on failure.  If *v* is *NULL*, the contents of the
    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, ...)
 
@@ -134,6 +138,10 @@
 
    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)
 
@@ -202,6 +210,9 @@
    fails, the original string object at *\*string* is deallocated, *\*string* is
    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)
 

Modified: python/trunk/Doc/c-api/tuple.rst
==============================================================================
--- python/trunk/Doc/c-api/tuple.rst	(original)
+++ python/trunk/Doc/c-api/tuple.rst	Sat Apr 25 19:59:03 2009
@@ -42,6 +42,10 @@
 
    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, ...)
 
@@ -51,11 +55,19 @@
 
    .. 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)
 
    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)
 
@@ -68,6 +80,10 @@
    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.
 
+   .. 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)
 
@@ -79,6 +95,10 @@
    Take a slice of the tuple pointed to by *p* from *low* to *high* and return it
    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)
 
@@ -89,6 +109,10 @@
 
       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)
 
@@ -116,6 +140,10 @@
    .. versionchanged:: 2.2
       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)
 

Modified: python/trunk/Doc/c-api/type.rst
==============================================================================
--- python/trunk/Doc/c-api/type.rst	(original)
+++ python/trunk/Doc/c-api/type.rst	Sat Apr 25 19:59:03 2009
@@ -76,6 +76,10 @@
 
    .. 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)
 


More information about the Python-checkins mailing list