Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 037ffbf

Browse files
committed
Improve the porting section
1 parent fd9b416 commit 037ffbf

1 file changed

Lines changed: 24 additions & 6 deletions

File tree

Doc/whatsnew/3.3.rst

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
This article explains the new features in Python 3.3, compared to 3.2.
5050

5151

52+
.. _pep-393:
53+
5254
PEP 393: Flexible String Representation
5355
=======================================
5456

@@ -540,14 +542,35 @@ Porting to Python 3.3
540542
=====================
541543

542544
This section lists previously described changes and other bugfixes
543-
that may require changes to your code:
545+
that may require changes to your code.
546+
547+
Porting Python code
548+
-------------------
544549

545550
* Issue #12326: On Linux, sys.platform doesn't contain the major version
546551
anymore. It is now always 'linux', instead of 'linux2' or 'linux3' depending
547552
on the Linux version used to build Python. Replace sys.platform == 'linux2'
548553
with sys.platform.startswith('linux'), or directly sys.platform == 'linux' if
549554
you don't need to support older Python versions.
550555

556+
Porting C code
557+
--------------
558+
559+
* Due to :ref:`PEP 393 <pep-393>`, the :c:type:`Py_UNICODE` type and all
560+
functions using this type are deprecated (but will stay available for
561+
at least five years). If you were using low-level Unicode APIs to
562+
construct and access unicode objects and you want to benefit of the
563+
memory footprint reduction provided by the PEP 393, you have to convert
564+
your code to the new :doc:`Unicode API <../c-api/unicode>`.
565+
566+
However, if you only have been using high-level functions such as
567+
:c:func:`PyUnicode_Concat()`, :c:func:`PyUnicode_Join` or
568+
:c:func:`PyUnicode_FromFormat()`, your code will automatically take
569+
advantage of the new unicode representations.
570+
571+
Other issues
572+
------------
573+
551574
.. Issue #11591: When :program:`python` was started with :option:`-S`,
552575
``import site`` will not add site-specific paths to the module search
553576
paths. In previous versions, it did. See changeset for doc changes in
@@ -557,8 +580,3 @@ that may require changes to your code:
557580
removed. Code checking sys.flags.division_warning will need updating.
558581
Contributed by Éric Araujo.
559582
560-
* :pep:`393`: The :c:type:`Py_UNICODE` type and all functions using this type
561-
are deprecated. To fully benefit of the memory footprint reduction provided
562-
by the PEP 393, you have to convert your code to the new Unicode API. Read
563-
the porting guide: XXX.
564-

0 commit comments

Comments
 (0)