2008-12-04 14:44:53 -04:00
|
|
|
****************************
|
2009-01-03 17:18:54 -04:00
|
|
|
What's New In Python 3.1
|
2008-12-04 14:44:53 -04:00
|
|
|
****************************
|
|
|
|
|
|
|
|
.. XXX Add trademark info for Apple, Microsoft.
|
|
|
|
|
|
|
|
:Author: No one so far
|
2008-12-04 23:05:29 -04:00
|
|
|
:Release: |release|
|
|
|
|
:Date: |today|
|
2008-12-04 14:44:53 -04:00
|
|
|
|
|
|
|
.. $Id$
|
|
|
|
Rules for maintenance:
|
2009-01-03 17:18:54 -04:00
|
|
|
|
2008-12-04 14:44:53 -04:00
|
|
|
* Anyone can add text to this document. Do not spend very much time
|
|
|
|
on the wording of your changes, because your text will probably
|
|
|
|
get rewritten to some degree.
|
2009-01-03 17:18:54 -04:00
|
|
|
|
2008-12-04 14:44:53 -04:00
|
|
|
* The maintainer will go through Misc/NEWS periodically and add
|
|
|
|
changes; it's therefore more important to add your changes to
|
|
|
|
Misc/NEWS than to this file. (Note: I didn't get to this for 3.0.
|
|
|
|
GvR.)
|
2009-01-03 17:18:54 -04:00
|
|
|
|
2008-12-04 14:44:53 -04:00
|
|
|
* This is not a complete list of every single change; completeness
|
|
|
|
is the purpose of Misc/NEWS. Some changes I consider too small
|
|
|
|
or esoteric to include. If such a change is added to the text,
|
|
|
|
I'll just remove it. (This is another reason you shouldn't spend
|
|
|
|
too much time on writing your addition.)
|
2009-01-03 17:18:54 -04:00
|
|
|
|
2008-12-04 14:44:53 -04:00
|
|
|
* If you want to draw your new text to the attention of the
|
|
|
|
maintainer, add 'XXX' to the beginning of the paragraph or
|
|
|
|
section.
|
2009-01-03 17:18:54 -04:00
|
|
|
|
2008-12-04 14:44:53 -04:00
|
|
|
* It's OK to just add a fragmentary note about a change. For
|
|
|
|
example: "XXX Describe the transmogrify() function added to the
|
|
|
|
socket module." The maintainer will research the change and
|
|
|
|
write the necessary text.
|
2009-01-03 17:18:54 -04:00
|
|
|
|
2008-12-04 14:44:53 -04:00
|
|
|
* You can comment out your additions if you like, but it's not
|
|
|
|
necessary (especially when a final release is some months away).
|
2009-01-03 17:18:54 -04:00
|
|
|
|
2008-12-04 14:44:53 -04:00
|
|
|
* Credit the author of a patch or bugfix. Just the name is
|
|
|
|
sufficient; the e-mail address isn't necessary. (Due to time
|
|
|
|
constraints I haven't managed to do this for 3.0. GvR.)
|
2009-01-03 17:18:54 -04:00
|
|
|
|
2008-12-04 14:44:53 -04:00
|
|
|
* It's helpful to add the bug/patch number as a comment:
|
2009-01-03 17:18:54 -04:00
|
|
|
|
2008-12-04 14:44:53 -04:00
|
|
|
% Patch 12345
|
|
|
|
XXX Describe the transmogrify() function added to the socket
|
|
|
|
module.
|
|
|
|
(Contributed by P.Y. Developer.)
|
2009-01-03 17:18:54 -04:00
|
|
|
|
2008-12-04 14:44:53 -04:00
|
|
|
This saves the maintainer the effort of going through the SVN log
|
|
|
|
when researching a change. (Again, I didn't get to this for 3.0.
|
|
|
|
GvR.)
|
|
|
|
|
|
|
|
This article explains the new features in Python 3.1, compared to 3.0.
|
|
|
|
|
|
|
|
.. Compare with previous release in 2 - 3 sentences here.
|
|
|
|
.. add hyperlink when the documentation becomes available online.
|
|
|
|
|
|
|
|
.. ======================================================================
|
|
|
|
.. Large, PEP-level features and changes should be described here.
|
|
|
|
.. Should there be a new section here for 3k migration?
|
|
|
|
.. Or perhaps a more general section describing module changes/deprecation?
|
|
|
|
.. sets module deprecated
|
|
|
|
.. ======================================================================
|
|
|
|
|
|
|
|
|
2008-12-17 12:19:07 -04:00
|
|
|
Other Language Changes
|
|
|
|
======================
|
|
|
|
|
|
|
|
Some smaller changes made to the core Python language are:
|
|
|
|
|
|
|
|
* The :func:`int` type gained a ``bit_length`` method that returns the
|
|
|
|
number of bits necessary to represent its argument in binary::
|
|
|
|
|
|
|
|
>>> n = 37
|
|
|
|
>>> bin(37)
|
|
|
|
'0b100101'
|
|
|
|
>>> n.bit_length()
|
|
|
|
6
|
|
|
|
>>> n = 2**123-1
|
|
|
|
>>> n.bit_length()
|
|
|
|
123
|
|
|
|
>>> (n+1).bit_length()
|
|
|
|
124
|
|
|
|
|
|
|
|
(Contributed by Fredrik Johansson and Victor Stinner; :issue:`3439`.)
|
|
|
|
|
|
|
|
|
2008-12-04 14:44:53 -04:00
|
|
|
.. ======================================================================
|