.. _whats-new-in-2.6:
****************************
What's New in Python 2.6
****************************
.. XXX add trademark info for Apple, Microsoft, SourceForge.
:Author: A.M. Kuchling (amk at amk.ca)
:Release: |release|
:Date: |today|
.. $Id: 2.6.rst 73214 2009-06-04 10:21:10Z georg.brandl $
Rules for maintenance:
* 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.
* 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.
* 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.)
* If you want to draw your new text to the attention of the
maintainer, add 'XXX' to the beginning of the paragraph or
section.
* 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.
* You can comment out your additions if you like, but it's not
necessary (especially when a final release is some months away).
* Credit the author of a patch or bugfix. Just the name is
sufficient; the e-mail address isn't necessary.
* It's helpful to add the bug/patch number in a parenthetical comment.
XXX Describe the transmogrify() function added to the socket
module.
(Contributed by P.Y. Developer; :issue:`12345`.)
This saves the maintainer some effort going through the SVN logs
when researching a change.
This article explains the new features in Python 2.6, released on October 1
2008. The release schedule is described in :pep:`361`.
The major theme of Python 2.6 is preparing the migration path to
Python 3.0, a major redesign of the language. Whenever possible,
Python 2.6 incorporates new features and syntax from 3.0 while
remaining compatible with existing code by not removing older features
or syntax. When it's not possible to do that, Python 2.6 tries to do
what it can, adding compatibility functions in a
:mod:`future_builtins` module and a :option:`-3` switch to warn about
usages that will become unsupported in 3.0.
Some significant new packages have been added to the standard library,
such as the :mod:`multiprocessing` and :mod:`json` modules, but
there aren't many new features that aren't related to Python 3.0 in
some way.
Python 2.6 also sees a number of improvements and bugfixes throughout
the source. A search through the change logs finds there were 259
patches applied and 612 bugs fixed between Python 2.5 and 2.6. Both
figures are likely to be underestimates.
This article doesn't attempt to provide a complete specification of
the new features, but instead provides a convenient overview. For
full details, you should refer to the documentation for Python 2.6. If
you want to understand the rationale for the design and
implementation, refer to the PEP for a particular new feature.
Whenever possible, "What's New in Python" links to the bug/patch item
for each change.
.. 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.
.. ========================================================================
Python 3.0
================
The development cycle for Python versions 2.6 and 3.0 was
synchronized, with the alpha and beta releases for both versions being
made on the same days. The development of 3.0 has influenced many
features in 2.6.
Python 3.0 is a far-ranging redesign of Python that breaks
compatibility with the 2.x series. This means that existing Python
code will need some conversion in order to run on
Python 3.0. However, not all the changes in 3.0 necessarily break
compatibility. In cases where new features won't cause existing code
to break, they've been backported to 2.6 and are described in this
document in the appropriate place. Some of the 3.0-derived features
are:
* A :meth:`__complex__` method for converting objects to a complex number.
* Alternate syntax for catching exceptions: ``except TypeError as exc``.
* The addition of :func:`functools.reduce` as a synonym for the built-in
:func:`reduce` function.
Python 3.0 adds several new built-in functions and changes the
semantics of some existing built-ins. Functions that are new in 3.0
such as :func:`bin` have simply been added to Python 2.6, but existing
built-ins haven't been changed; instead, the :mod:`future_builtins`
module has versions with the new 3.0 semantics. Code written to be
compatible with 3.0 can do ``from future_builtins import hex, map`` as
necessary.
A new command-line switch, :option:`-3`, enables warnings
about features that will be removed in Python 3.0. You can run code
with this switch to see how much work will be necessary to port
code to 3.0. The value of this switch is available
to Python code as the boolean variable :data:`sys.py3kwarning`,
and to C extension code as :cdata:`Py_Py3kWarningFlag`.
.. seealso::
The 3xxx series of PEPs, which contains proposals for Python 3.0.
:pep:`3000` describes the development process for Python 3.0.
Start with :pep:`3100` that describes the general goals for Python
3.0, and then explore the higher-numbered PEPS that propose
specific features.
Changes to the Development Process
==================================================
While 2.6 was being developed, the Python development process
underwent two significant changes: we switched from SourceForge's
issue tracker to a customized Roundup installation, and the
documentation was converted from LaTeX to reStructuredText.
New Issue Tracker: Roundup
--------------------------------------------------
For a long time, the Python developers had been growing increasingly
annoyed by SourceForge's bug tracker. SourceForge's hosted solution
doesn't permit much customization; for example, it wasn't possible to
customize the life cycle of issues.
The infrastructure committee of the Python Software Foundation
therefore posted a call for issue trackers, asking volunteers to set
up different products and import some of the bugs and patches from
SourceForge. Four different trackers were examined: `Jira
<http://www.atlassian.com/software/jira/>`__,
`Launchpad <http://www.launchpad.net>`__,
`Roundup <http://roundup.sourceforge.net/>`__, and
`Trac <http://trac.edgewall.org/>`__.
The committee eventually settled on Jira
and Roundup as the two candidates. Jira is a commercial product that
offers no-cost hosted instances to free-software projects; Roundup
is an open-source project that requires volunteers
to administer it and a server to host it.
After posting a call for volunteers, a new Roundup installation was
set up at http://bugs.python.org. One installation of Roundup can
host multiple trackers, and this server now also hosts issue trackers
for Jython and for the Python web site. It will surely find
other uses in the future. Where possible,
this edition of "What's New in Python" links to the bug/patch
item for each change.
Hosting of the Python bug tracker is kindly provided by
`Upfront Systems <http://www.upfrontsystems.co.za/>`__
of Stellenbosch, South Africa. Martin von Loewis put a
lot of effort into importing existing bugs and patches from
SourceForge; his scripts for this import operation are at
http://svn.python.org/view/tracker/importer/ and may be useful to
other projects wishing to move from SourceForge to Roundup.
.. seealso::
http://bugs.pyth
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
python 3.1 官方文档 (840个子文件)
.buildinfo 230B
basic.css 6KB
default.css 3KB
pygments.css 3KB
genindex-all.html 881KB
multiprocessing.html 321KB
contents.html 307KB
2.6.html 300KB
logging.html 267KB
newtypes.html 245KB
ctypes.html 228KB
turtle.html 224KB
2.5.html 223KB
stdtypes.html 220KB
2.3.html 206KB
datetime.html 195KB
optparse.html 188KB
decimal.html 183KB
os.html 172KB
datamodel.html 171KB
apiref.html 163KB
2.4.html 150KB
doctest.html 150KB
functional.html 138KB
genindex-P.html 137KB
mailbox.html 135KB
typeobj.html 134KB
unittest.html 134KB
regex.html 133KB
re.html 132KB
curses.html 131KB
functions.html 127KB
2.2.html 125KB
urllib.request.html 125KB
extending.html 125KB
2.0.html 118KB
expressions.html 118KB
sqlite3.html 113KB
collections.html 112KB
3.0.html 101KB
tkinter.ttk.html 101KB
codecs.html 93KB
genindex-S.html 92KB
socket.html 89KB
unicode.html 89KB
simple_stmts.html 84KB
xml.dom.html 84KB
init.html 84KB
http.cookiejar.html 80KB
itertools.html 79KB
wsgiref.html 78KB
sys.html 77KB
io.html 76KB
difflib.html 75KB
classes.html 75KB
index.html 73KB
modindex.html 71KB
pickle.html 70KB
controlflow.html 70KB
2.1.html 70KB
threading.html 69KB
datastructures.html 67KB
pyexpat.html 67KB
parser.html 66KB
tarfile.html 65KB
genindex-C.html 65KB
ssl.html 65KB
urllib2.html 64KB
2.7.html 63KB
genindex-E.html 62KB
setupscript.html 61KB
tkinter.html 60KB
intro.html 60KB
gettext.html 60KB
dis.html 60KB
subprocess.html 60KB
compound_stmts.html 59KB
unicode.html 59KB
operator.html 59KB
lexical_analysis.html 58KB
3.1.html 57KB
genindex-R.html 57KB
exceptions.html 57KB
arg.html 57KB
introduction.html 57KB
genindex-G.html 56KB
index.html 56KB
xmlrpc.client.html 56KB
string.html 55KB
profile.html 55KB
email.message.html 55KB
glossary.html 54KB
time.html 53KB
webservers.html 52KB
http.client.html 52KB
modules.html 52KB
genindex-I.html 52KB
csv.html 51KB
markup.html 51KB
configparser.html 51KB
共 840 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
rainbowx
- 粉丝: 1
- 资源: 29
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1