Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
92ed3877
Commit
92ed3877
authored
Dec 18, 2011
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
a7425263
ac0675cc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
12 deletions
+23
-12
Doc/ACKS.txt
Doc/ACKS.txt
+1
-0
Doc/c-api/unicode.rst
Doc/c-api/unicode.rst
+19
-9
Objects/dictobject.c
Objects/dictobject.c
+3
-3
No files found.
Doc/ACKS.txt
View file @
92ed3877
...
...
@@ -33,6 +33,7 @@ docs@python.org), and we'll be glad to correct the problem.
* Keith Briggs
* Ian Bruntlett
* Lee Busby
* Arnaud Calmettes
* Lorenzo M. Catucci
* Carl Cerecke
* Mauro Cicognini
...
...
Doc/c-api/unicode.rst
View file @
92ed3877
...
...
@@ -338,16 +338,21 @@ APIs:
.. c:function:: Py_UNICODE* PyUnicode_AsUnicode(PyObject *unicode)
Return a read-only pointer to the Unicode object's internal :c:type:`Py_UNICODE`
buffer, *NULL* if *unicode* is not a Unicode object.
Return a read-only pointer to the Unicode object's internal
:c:type:`Py_UNICODE` buffer, *NULL* if *unicode* is not a Unicode object.
Note that the resulting :c:type:`Py_UNICODE*` string may contain embedded
null characters, which would cause the string to be truncated when used in
most C functions.
.. c:function:: Py_UNICODE* PyUnicode_AsUnicodeCopy(PyObject *unicode)
Create a copy of a Unicode string ending with a nul character. Return *NULL*
and raise a :exc:`MemoryError` exception on memory allocation failure,
otherwise return a new allocated buffer (use :c:func:`PyMem_Free` to free the
buffer).
otherwise return a new allocated buffer (use :c:func:`PyMem_Free` to free
the buffer). Note that the resulting :c:type:`Py_UNICODE*` string may contain
embedded null characters, which would cause the string to be truncated when
used in most C functions.
.. versionadded:: 3.2
...
...
@@ -447,7 +452,8 @@ used, passing :c:func:`PyUnicode_FSDecoder` as the conversion function:
Encode a Unicode object to :c:data:`Py_FileSystemDefaultEncoding` with the
``'surrogateescape'`` error handler, or ``'strict'`` on Windows, and return
:class:`bytes`.
:class:`bytes`. Note that the resulting :class:`bytes` object may contain
null bytes.
If :c:data:`Py_FileSystemDefaultEncoding` is not set, fall back to the
locale encoding.
...
...
@@ -476,7 +482,9 @@ wchar_t Support
copied or -1 in case of an error. Note that the resulting :c:type:`wchar_t`
string may or may not be 0-terminated. It is the responsibility of the caller
to make sure that the :c:type:`wchar_t` string is 0-terminated in case this is
required by the application.
required by the application. Also, note that the :c:type:`wchar_t*` string
might contain null characters, which would cause the string to be truncated
when used with most C functions.
.. c:function:: wchar_t* PyUnicode_AsWideCharString(PyObject *unicode, Py_ssize_t *size)
...
...
@@ -486,9 +494,11 @@ wchar_t Support
of wide characters (excluding the trailing 0-termination character) into
*\*size*.
Returns a buffer allocated by :c:func:`PyMem_Alloc` (use :c:func:`PyMem_Free`
to free it) on success. On error, returns *NULL*, *\*size* is undefined and
raises a :exc:`MemoryError`.
Returns a buffer allocated by :c:func:`PyMem_Alloc` (use
:c:func:`PyMem_Free` to free it) on success. On error, returns *NULL*,
*\*size* is undefined and raises a :exc:`MemoryError`. Note that the
resulting :c:type:`wchar_t*` string might contain null characters, which
would cause the string to be truncated when used with most C functions.
.. versionadded:: 3.2
...
...
Objects/dictobject.c
View file @
92ed3877
...
...
@@ -1973,9 +1973,9 @@ PyDoc_STRVAR(popitem__doc__,
2-tuple; but raise KeyError if D is empty."
);
PyDoc_STRVAR
(
update__doc__
,
"D.update(
E,
**F) -> None. Update D from dict/iterable E and F.
\n
"
"If E has a .keys() method, does: for k in E: D[k] = E[k]
\n
\
If E lacks .keys() method, does: for (k, v) in E: D[k] = v
\n
\
"D.update(
[E, ]
**F) -> None. Update D from dict/iterable E and F.
\n
"
"If E
present and
has a .keys() method, does: for k in E: D[k] = E[k]
\n
\
If E
present and
lacks .keys() method, does: for (k, v) in E: D[k] = v
\n
\
In either case, this is followed by: for k in F: D[k] = F[k]"
);
PyDoc_STRVAR
(
fromkeys__doc__
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment