Merged revisions 71873-71874,71882,71890,71893,71898-71900,71910,71914-71923,71925-71929,71931-71934,71937 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r71873 | jeroen.ruigrok | 2009-04-25 13:15:06 +0200 (za, 25 apr 2009) | 2 lines
Reformat prior to expanding.
........
r71874 | jeroen.ruigrok | 2009-04-25 13:59:09 +0200 (za, 25 apr 2009) | 2 lines
First attempt to document PyObject_HEAD_INIT and PyVarObject_HEAD_INIT.
........
r71882 | jeroen.ruigrok | 2009-04-25 14:49:10 +0200 (za, 25 apr 2009) | 3 lines
Issue #4239: adjust email examples not to use connect() and terminate with
quit() and not close().
........
r71890 | jeroen.ruigrok | 2009-04-25 15:07:40 +0200 (za, 25 apr 2009) | 3 lines
Rewrite a sentence to be more in line with the rest of the documentation with
regard to person and audience.
........
r71893 | jeroen.ruigrok | 2009-04-25 15:58:58 +0200 (za, 25 apr 2009) | 2 lines
Reformat file prior to editing.
........
r71898 | jeroen.ruigrok | 2009-04-25 16:24:30 +0200 (za, 25 apr 2009) | 2 lines
Reformat prior to editing.
........
r71899 | jeroen.ruigrok | 2009-04-25 16:27:00 +0200 (za, 25 apr 2009) | 3 lines
The type for ppos has been Py_ssize_t since 2.5, reflect this in the
documentation.
........
r71900 | jeroen.ruigrok | 2009-04-25 16:28:02 +0200 (za, 25 apr 2009) | 2 lines
Reformat paragraph.
........
r71910 | jeroen.ruigrok | 2009-04-25 19:59:03 +0200 (za, 25 apr 2009) | 4 lines
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.
........
r71914 | jeroen.ruigrok | 2009-04-25 20:31:20 +0200 (za, 25 apr 2009) | 2 lines
Reformat prior to editing.
........
r71915 | jeroen.ruigrok | 2009-04-25 20:46:03 +0200 (za, 25 apr 2009) | 2 lines
Issue #4129: Document more int -> Py_ssize_t changes.
........
r71916 | jeroen.ruigrok | 2009-04-25 20:53:48 +0200 (za, 25 apr 2009) | 2 lines
Reformat prior to editing.
........
r71917 | jeroen.ruigrok | 2009-04-25 20:57:32 +0200 (za, 25 apr 2009) | 2 lines
Reference to an int type, whereas it's a Py_ssize_t as the synopsis states.
........
r71918 | jeroen.ruigrok | 2009-04-25 21:04:15 +0200 (za, 25 apr 2009) | 2 lines
Since I edited this file, reformat for future edits.
........
r71919 | jeroen.ruigrok | 2009-04-25 21:10:52 +0200 (za, 25 apr 2009) | 2 lines
Reformat prior to editing.
........
r71920 | jeroen.ruigrok | 2009-04-25 21:44:55 +0200 (za, 25 apr 2009) | 5 lines
Issue #4129: More documentation pointers about int -> Py_ssize_t.
Also fix up the documentation for PyObject_GC_Resize(). It seems that since
it first got documented, the documentation was actually for
_PyObject_GC_Resize().
........
r71921 | jeroen.ruigrok | 2009-04-25 21:46:19 +0200 (za, 25 apr 2009) | 2 lines
Issue #4129: Documentation notes for int -> Py_ssize_t changes.
........
r71922 | jeroen.ruigrok | 2009-04-25 21:49:05 +0200 (za, 25 apr 2009) | 2 lines
Reformat, since I've been busy here anyway.
........
r71923 | jeroen.ruigrok | 2009-04-25 21:54:34 +0200 (za, 25 apr 2009) | 2 lines
Issue #4129: Add a versionchanged notice for a few forgotten entries.
........
r71925 | jeroen.ruigrok | 2009-04-25 22:37:39 +0200 (za, 25 apr 2009) | 2 lines
Since it's a macro, actually refer to it as such instead of function.
........
r71926 | jeroen.ruigrok | 2009-04-25 22:40:10 +0200 (za, 25 apr 2009) | 2 lines
Reformat prior to editing.
........
r71927 | jeroen.ruigrok | 2009-04-25 22:41:40 +0200 (za, 25 apr 2009) | 2 lines
Issue #4129: int -> Py_ssize_t documentation.
........
r71928 | jeroen.ruigrok | 2009-04-25 22:43:30 +0200 (za, 25 apr 2009) | 2 lines
Reformat prior to editing.
........
r71929 | jeroen.ruigrok | 2009-04-25 22:44:58 +0200 (za, 25 apr 2009) | 2 lines
Issue #4129: int -> Py_ssize_t documentation.
........
r71931 | jeroen.ruigrok | 2009-04-25 22:50:27 +0200 (za, 25 apr 2009) | 2 lines
Issue #4129: int -> Py_ssize_t documentation.
........
r71932 | jeroen.ruigrok | 2009-04-25 22:55:39 +0200 (za, 25 apr 2009) | 2 lines
Issue #4129: more int -> Py_ssize_t documentation.
........
r71933 | jeroen.ruigrok | 2009-04-25 22:58:35 +0200 (za, 25 apr 2009) | 2 lines
Issue #4129: more int -> Py_ssize_t documentation.
........
r71934 | jeroen.ruigrok | 2009-04-25 23:02:34 +0200 (za, 25 apr 2009) | 2 lines
Issue #4129: field changed from int to Py_ssize_t.
........
r71937 | jeroen.ruigrok | 2009-04-25 23:16:05 +0200 (za, 25 apr 2009) | 2 lines
Issue #4129: document int -> Py_ssize_t changes.
........
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index 5e5d1a2..8469ff9 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -71,12 +71,20 @@
Return the size of the object. *o* has to be a :ctype:`PyUnicodeObject` (not
checked).
+ .. 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 PyUnicode_GET_DATA_SIZE(PyObject *o)
Return the size of the object's internal buffer in bytes. *o* has to be a
:ctype:`PyUnicodeObject` (not checked).
+ .. 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_UNICODE* PyUnicode_AS_UNICODE(PyObject *o)
@@ -202,6 +210,10 @@
Therefore, modification of the resulting Unicode object is only allowed when *u*
is *NULL*.
+ .. 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:: Py_UNICODE* PyUnicode_AsUnicode(PyObject *unicode)
@@ -213,6 +225,10 @@
Return the length of the Unicode object.
+ .. 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* PyUnicode_FromEncodedObject(PyObject *obj, const char *encoding, const char *errors)
@@ -249,6 +265,10 @@
Create a Unicode object from the :ctype:`wchar_t` buffer *w* of the given size.
Return *NULL* on failure.
+ .. 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:: Py_ssize_t PyUnicode_AsWideChar(PyUnicodeObject *unicode, wchar_t *w, Py_ssize_t size)
@@ -260,6 +280,11 @@
to make sure that the :ctype:`wchar_t` string is 0-terminated in case this is
required by the application.
+ .. versionchanged:: 2.5
+ This function returned an :ctype:`int` type and used an :ctype:`int`
+ type for *size*. This might require changes in your code for properly
+ supporting 64-bit systems.
+
.. _builtincodecs:
@@ -299,6 +324,10 @@
using the Python codec registry. Return *NULL* if an exception was raised by
the codec.
+ .. 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* PyUnicode_Encode(const Py_UNICODE *s, Py_ssize_t size, const char *encoding, const char *errors)
@@ -308,6 +337,10 @@
looked up using the Python codec registry. Return *NULL* if an exception was
raised by the codec.
+ .. 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* PyUnicode_AsEncodedString(PyObject *unicode, const char *encoding, const char *errors)
@@ -327,6 +360,10 @@
Create a Unicode object by decoding *size* bytes of the UTF-8 encoded string
*s*. Return *NULL* if an exception was raised by the codec.
+ .. 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* PyUnicode_DecodeUTF8Stateful(const char *s, Py_ssize_t size, const char *errors, Py_ssize_t *consumed)
@@ -337,12 +374,20 @@
.. versionadded:: 2.4
+ .. 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* PyUnicode_EncodeUTF8(const Py_UNICODE *s, Py_ssize_t size, const char *errors)
Encode the :ctype:`Py_UNICODE` buffer of the given size using UTF-8 and return a
Python string object. Return *NULL* if an exception was raised by the codec.
+ .. 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* PyUnicode_AsUTF8String(PyObject *unicode)
@@ -450,6 +495,10 @@
Return *NULL* if an exception was raised by the codec.
+ .. 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* PyUnicode_DecodeUTF16Stateful(const char *s, Py_ssize_t size, const char *errors, int *byteorder, Py_ssize_t *consumed)
@@ -461,6 +510,11 @@
.. versionadded:: 2.4
+ .. versionchanged:: 2.5
+ This function used an :ctype:`int` type for *size* and an :ctype:`int *`
+ type for *consumed*. This might require changes in your code for
+ properly supporting 64-bit systems.
+
.. cfunction:: PyObject* PyUnicode_EncodeUTF16(const Py_UNICODE *s, Py_ssize_t size, const char *errors, int byteorder)
@@ -481,6 +535,10 @@
Return *NULL* if an exception was raised by the codec.
+ .. 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* PyUnicode_AsUTF16String(PyObject *unicode)
@@ -498,6 +556,10 @@
Create a Unicode object by decoding *size* bytes of the Unicode-Escape encoded
string *s*. Return *NULL* if an exception was raised by the codec.
+ .. 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* PyUnicode_EncodeUnicodeEscape(const Py_UNICODE *s, Py_ssize_t size)
@@ -505,6 +567,10 @@
return a Python string object. Return *NULL* if an exception was raised by the
codec.
+ .. 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* PyUnicode_AsUnicodeEscapeString(PyObject *unicode)
@@ -522,6 +588,10 @@
Create a Unicode object by decoding *size* bytes of the Raw-Unicode-Escape
encoded string *s*. Return *NULL* if an exception was raised by the codec.
+ .. 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* PyUnicode_EncodeRawUnicodeEscape(const Py_UNICODE *s, Py_ssize_t size, const char *errors)
@@ -529,6 +599,10 @@
and return a Python string object. Return *NULL* if an exception was raised by
the codec.
+ .. 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* PyUnicode_AsRawUnicodeEscapeString(PyObject *unicode)
@@ -547,12 +621,20 @@
Create a Unicode object by decoding *size* bytes of the Latin-1 encoded string
*s*. Return *NULL* if an exception was raised by the codec.
+ .. 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* PyUnicode_EncodeLatin1(const Py_UNICODE *s, Py_ssize_t size, const char *errors)
Encode the :ctype:`Py_UNICODE` buffer of the given size using Latin-1 and return
a Python string object. Return *NULL* if an exception was raised by the codec.
+ .. 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* PyUnicode_AsLatin1String(PyObject *unicode)
@@ -571,12 +653,20 @@
Create a Unicode object by decoding *size* bytes of the ASCII encoded string
*s*. Return *NULL* if an exception was raised by the codec.
+ .. 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* PyUnicode_EncodeASCII(const Py_UNICODE *s, Py_ssize_t size, const char *errors)
Encode the :ctype:`Py_UNICODE` buffer of the given size using ASCII and return a
Python string object. Return *NULL* if an exception was raised by the codec.
+ .. 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* PyUnicode_AsASCIIString(PyObject *unicode)
@@ -622,6 +712,10 @@
.. versionchanged:: 2.4
Allowed unicode string as mapping argument.
+ .. 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* PyUnicode_EncodeCharmap(const Py_UNICODE *s, Py_ssize_t size, PyObject *mapping, const char *errors)
@@ -629,6 +723,10 @@
*mapping* object and return a Python string object. Return *NULL* if an
exception was raised by the codec.
+ .. 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* PyUnicode_AsCharmapString(PyObject *unicode, PyObject *mapping)
@@ -652,6 +750,10 @@
and sequences work well. Unmapped character ordinals (ones which cause a
:exc:`LookupError`) are left untouched and are copied as-is.
+ .. 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.
+
These are the MBCS codec APIs. They are currently only available on Windows and
use the Win32 MBCS converters to implement the conversions. Note that MBCS (or
DBCS) is a class of encodings, not just one. The target encoding is defined by
@@ -665,6 +767,10 @@
Create a Unicode object by decoding *size* bytes of the MBCS encoded string *s*.
Return *NULL* if an exception was raised by the codec.
+ .. 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* PyUnicode_DecodeMBCSStateful(const char *s, int size, const char *errors, int *consumed)
@@ -681,6 +787,10 @@
Encode the :ctype:`Py_UNICODE` buffer of the given size using MBCS and return a
Python string object. Return *NULL* if an exception was raised by the codec.
+ .. 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* PyUnicode_AsMBCSString(PyObject *unicode)
@@ -715,6 +825,10 @@
separator. At most *maxsplit* splits will be done. If negative, no limit is
set. Separators are not included in the resulting list.
+ .. versionchanged:: 2.5
+ This function used an :ctype:`int` type for *maxsplit*. This might require
+ changes in your code for properly supporting 64-bit systems.
+
.. cfunction:: PyObject* PyUnicode_Splitlines(PyObject *s, int keepend)
@@ -751,6 +865,11 @@
(*direction* == -1 means to do a prefix match, *direction* == 1 a suffix match),
0 otherwise. Return ``-1`` if an error occurred.
+ .. versionchanged:: 2.5
+ This function used an :ctype:`int` type for *start* and *end*. This
+ might require changes in your code for properly supporting 64-bit
+ systems.
+
.. cfunction:: Py_ssize_t PyUnicode_Find(PyObject *str, PyObject *substr, Py_ssize_t start, Py_ssize_t end, int direction)
@@ -760,12 +879,22 @@
``-1`` indicates that no match was found, and ``-2`` indicates that an error
occurred and an exception has been set.
+ .. versionchanged:: 2.5
+ This function used an :ctype:`int` type for *start* and *end*. This
+ might require changes in your code for properly supporting 64-bit
+ systems.
+
.. cfunction:: Py_ssize_t PyUnicode_Count(PyObject *str, PyObject *substr, Py_ssize_t start, Py_ssize_t end)
Return the number of non-overlapping occurrences of *substr* in
``str[start:end]``. Return ``-1`` if an error occurred.
+ .. versionchanged:: 2.5
+ This function returned an :ctype:`int` type and used an :ctype:`int`
+ type for *start* and *end*. This might require changes in your code for
+ properly supporting 64-bit systems.
+
.. cfunction:: PyObject* PyUnicode_Replace(PyObject *str, PyObject *substr, PyObject *replstr, Py_ssize_t maxcount)
@@ -773,6 +902,10 @@
return the resulting Unicode object. *maxcount* == -1 means replace all
occurrences.
+ .. versionchanged:: 2.5
+ This function used an :ctype:`int` type for *maxcount*. This might
+ require changes in your code for properly supporting 64-bit systems.
+
.. cfunction:: int PyUnicode_Compare(PyObject *left, PyObject *right)