blob: e657af24720264144c00a5b2d993a606f2e7a42a [file] [log] [blame]
Giampaolo Rodolà3108f982011-02-24 20:59:48 +00001****************************
2 What's New In Python 3.3
3****************************
4
5:Author: Raymond Hettinger
6:Release: |release|
7:Date: |today|
8
9.. $Id$
10 Rules for maintenance:
11
12 * Anyone can add text to this document. Do not spend very much time
13 on the wording of your changes, because your text will probably
14 get rewritten to some degree.
15
16 * The maintainer will go through Misc/NEWS periodically and add
17 changes; it's therefore more important to add your changes to
18 Misc/NEWS than to this file.
19
20 * This is not a complete list of every single change; completeness
21 is the purpose of Misc/NEWS. Some changes I consider too small
22 or esoteric to include. If such a change is added to the text,
23 I'll just remove it. (This is another reason you shouldn't spend
24 too much time on writing your addition.)
25
26 * If you want to draw your new text to the attention of the
27 maintainer, add 'XXX' to the beginning of the paragraph or
28 section.
29
30 * It's OK to just add a fragmentary note about a change. For
31 example: "XXX Describe the transmogrify() function added to the
32 socket module." The maintainer will research the change and
33 write the necessary text.
34
35 * You can comment out your additions if you like, but it's not
36 necessary (especially when a final release is some months away).
37
38 * Credit the author of a patch or bugfix. Just the name is
39 sufficient; the e-mail address isn't necessary.
40
41 * It's helpful to add the bug/patch number as a comment:
42
43 % Patch 12345
44 XXX Describe the transmogrify() function added to the socket
45 module.
46 (Contributed by P.Y. Developer.)
47
48 This saves the maintainer the effort of going through the SVN log
49 when researching a change.
50
51This article explains the new features in Python 3.3, compared to 3.2.
52
53
54PEP XXX: Stub
55=============
56
57
58Other Language Changes
59======================
60
61Some smaller changes made to the core Python language are:
62
63* Stub
64
65
66New, Improved, and Deprecated Modules
67=====================================
68
69* Stub
70
Victor Stinner024e37a2011-03-31 01:31:06 +020071faulthandler
72------------
73
74New module: :mod:`faulthandler`.
75
76 * :envvar:`PYTHONFAULTHANDLER`
77 * :option:`-X` ``faulthandler``
78
Victor Stinnerfa0e3d52011-05-09 01:01:09 +020079
80math
81----
82
83The :mod:`math` module has a new function:
84
85 * :func:`~math.log2`: return the base-2 logarithm of *x*
86 (Written by Mark Dickinson in :issue:`11888`).
87
88
89nntplib
90-------
91
92The :class:`nntplib.NNTP` class now supports the context manager protocol to
93unconditionally consume :exc:`socket.error` exceptions and to close the NNTP
94connection when done::
95
96 >>> from nntplib import NNTP
97 >>> with nntplib.NNTP('news.gmane.org') as n:
98 ... n.group('gmane.comp.python.committers')
99 ...
100 ('211 1454 1 1454 gmane.comp.python.committers', '1454', '1', '1454', 'gmane.comp.python.committers')
101 >>>
102
103(Contributed by Giampaolo Rodolà in :issue:`9795`)
104
105
Giampaolo Rodolàc9c2c8b2011-02-25 14:39:16 +0000106os
107--
108
Giampaolo Rodolà18e8bcb2011-02-25 20:57:54 +0000109* The :mod:`os` module has a new :func:`~os.sendfile` function which provides
110 an efficent "zero-copy" way for copying data from one file (or socket)
111 descriptor to another. The phrase "zero-copy" refers to the fact that all of
112 the copying of data between the two descriptors is done entirely by the
113 kernel, with no copying of data into userspace buffers. :func:`~os.sendfile`
114 can be used to efficiently copy data from a file on disk to a network socket,
115 e.g. for downloading a file.
Giampaolo Rodolàc9c2c8b2011-02-25 14:39:16 +0000116
Giampaolo Rodolà18e8bcb2011-02-25 20:57:54 +0000117 (Patch submitted by Ross Lagerwall and Giampaolo Rodolà in :issue:`10882`.)
118
119* The :mod:`os` module has two new functions: :func:`~os.getpriority` and
120 :func:`~os.setpriority`. They can be used to get or set process
121 niceness/priority in a fashion similar to :func:`os.nice` but extended to all
122 processes instead of just the current one.
123
124 (Patch submitted by Giampaolo Rodolà in :issue:`10784`.)
Giampaolo Rodolà3108f982011-02-24 20:59:48 +0000125
Giampaolo Rodolà424298a2011-03-03 18:34:06 +0000126
Victor Stinnerd5c355c2011-04-30 14:53:09 +0200127sys
128---
Victor Stinner754851f2011-04-19 23:58:51 +0200129
Victor Stinnerd5c355c2011-04-30 14:53:09 +0200130* The :mod:`sys` module has a new :func:`~sys.thread_info` :term:`struct
131 sequence` holding informations about the thread implementation.
Victor Stinner754851f2011-04-19 23:58:51 +0200132
Georg Brandl00db5822011-04-30 15:30:03 +0200133 (:issue:`11223`)
Victor Stinnera9293352011-04-30 15:21:58 +0200134
Victor Stinnerfa0e3d52011-05-09 01:01:09 +0200135
Victor Stinnera9293352011-04-30 15:21:58 +0200136signal
137------
138
Victor Stinnerfa0e3d52011-05-09 01:01:09 +0200139* The :mod:`signal` module has new functions:
Victor Stinnera9293352011-04-30 15:21:58 +0200140
Victor Stinnerb3e72192011-05-08 01:46:11 +0200141 * :func:`~signal.pthread_sigmask`: fetch and/or change the signal mask of the
142 calling thread (Contributed by Jean-Paul Calderone in :issue:`8407`) ;
143 * :func:`~signal.pthread_kill`: send a signal to a thread ;
144 * :func:`~signal.sigpending`: examine pending functions ;
145 * :func:`~signal.sigwait`: wait a signal.
Victor Stinnera9293352011-04-30 15:21:58 +0200146
Victor Stinnerd49b1f12011-05-08 02:03:15 +0200147* The signal handler writes the signal number as a single byte instead of
148 a nul byte into the wakeup file descriptor. So it is possible to wait more
149 than one signal and know which signals were raised.
150
Victor Stinner754851f2011-04-19 23:58:51 +0200151
Giampaolo Rodolà3108f982011-02-24 20:59:48 +0000152Optimizations
153=============
154
155Major performance enhancements have been added:
156
157* Stub
158
159
160Build and C API Changes
161=======================
162
163Changes to Python's build process and to the C API include:
164
165* Stub
166
167
Georg Brandl0cd25c92011-04-29 13:45:54 +0200168Unsupported Operating Systems
Victor Stinnerb90db4c2011-04-26 22:48:24 +0200169=============================
170
Brian Curtin49a40cd2011-05-02 22:30:06 -0500171OS/2 and VMS are no longer supported due to the lack of a maintainer.
172
173Windows 2000 and Windows platforms which set ``COMSPEC`` to ``command.com``
174are no longer supported due to maintenance burden.
Victor Stinnerb90db4c2011-04-26 22:48:24 +0200175
176
Giampaolo Rodolà3108f982011-02-24 20:59:48 +0000177Porting to Python 3.3
178=====================
179
180This section lists previously described changes and other bugfixes
181that may require changes to your code:
182
183* Stub
184
Éric Araujoc09fca62011-03-23 02:06:24 +0100185
186.. Issue #11591: When :program:`python` was started with :option:`-S`,
187 ``import site`` will not add site-specific paths to the module search
188 paths. In previous versions, it did. See changeset for doc changes in
189 various files. Contributed by Carl Meyer with editions by Éric Araujo.
Éric Araujobe3bd572011-03-26 01:55:15 +0100190
191.. Issue #10998: -Q command-line flags are related artifacts have been
192 removed. Code checking sys.flags.division_warning will need updating.
193 Contributed by Éric Araujo.