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
7d637ab8
Commit
7d637ab8
authored
Sep 29, 2011
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Complete What's New in 3.3 about PEP 393
parent
f503673c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
Doc/whatsnew/3.3.rst
Doc/whatsnew/3.3.rst
+28
-0
No files found.
Doc/whatsnew/3.3.rst
View file @
7d637ab8
...
...
@@ -65,6 +65,28 @@ XXX Add list of changes introduced by :pep:`393` here:
either ``0xFFFF`` or ``0x10FFFF`` for backward compatibility, and it should
not be used with the new Unicode API (see :issue:`13054`).
* Non-BMP characters (U+10000-U+10FFFF range) are no more special cases.
``'\U0010FFFF'[0]`` is now ``'\U0010FFFF'`` on any platform, instead of
``'\uDFFF'`` on narrow build or ``'\U0010FFFF'`` on wide build. And
``len('\U0010FFFF')`` is now ``1`` on any platform, instead of ``2`` on
narrow build or ``1`` on wide build. More generally, most bugs related to
non-BMP characters are now fixed. For example, :func:`unicodedata.normalize`
handles correctly non-BMP characters on all platforms.
* The storage of Unicode string is now adapted on the content of the string.
Pure ASCII and Latin1 strings (U+0000-U+00FF) use 1 byte per character, BMP
strings (U+0000-U+FFFF) use 2 bytes per character, and non-BMP characters
(U+10000-U+10FFFF range) use 4 bytes per characters. The memory usage of
Python 3.3 is two to three times smaller than Python 3.2, and a little bit
better than Python 2.7, on a `Django benchmark
<http://mail.python.org/pipermail/python-dev/2011-September/113714.html>`_.
* The PEP 393 is fully backward compatible. The legacy API should remain
available at least five years. Applications using the legacy API will not
fully benefit of the memory reduction, or worse may use a little bit more
memory, because Python may have to maintain two versions of each string (in
the legacy format and in the new efficient storage).
Other Language Changes
======================
...
...
@@ -334,3 +356,9 @@ that may require changes to your code:
.. Issue #10998: -Q command-line flags are related artifacts have been
removed. Code checking sys.flags.division_warning will need updating.
Contributed by Éric Araujo.
* :pep:`393`: The :c:type:`Py_UNICODE` type and all functions using this type
are deprecated. To fully benefit of the memory footprint reduction provided
by the PEP 393, you have to convert your code to the new Unicode API. Read
the porting guide: XXX.
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