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
8d2054aa
Commit
8d2054aa
authored
Sep 25, 2007
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add various items
parent
8e32dbcc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
105 additions
and
18 deletions
+105
-18
Doc/whatsnew/2.6.rst
Doc/whatsnew/2.6.rst
+105
-18
No files found.
Doc/whatsnew/2.6.rst
View file @
8d2054aa
...
...
@@ -75,7 +75,23 @@ Python 3.0
.. % XXX add general comment about Python 3.0 features in 2.6
.. % XXX mention -3 switch
The development cycle for Python 2.6 also saw the release of the first
alphas of Python 3.0, and the development of 3.0 has influenced
a number of 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 a certain amount of 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.
A new command-line switch, :option:`-3`, enables warnings
about features that will be removed in Python 3.0. You can run code
...
...
@@ -406,11 +422,6 @@ Other Language Changes
Here are all of the changes that Python 2.6 makes to the core Python language.
* Changes to the :class:`Exception` interface
as dictated by :pep:`352` continue to be made. For 2.6,
the :attr:`message` attribute is being deprecated in favor of the
:attr:`args` attribute.
* When calling a function using the ``**`` syntax to provide keyword
arguments, you are no longer required to use a Python dictionary;
any mapping will now work::
...
...
@@ -426,8 +437,29 @@ Here are all of the changes that Python 2.6 makes to the core Python language.
.. % Patch 1686487
* The built-in types now have improved support for extended slicing syntax,
where various combinations of ``(start, stop, step)`` are supplied.
Previously, the support was partial and certain corner cases wouldn't work.
(Implemented by Thomas Wouters.)
.. % Revision 57619
* C functions and methods that use
:cfunc:`PyComplex_AsCComplex` will now accept arguments that
have a :meth:`__complex__` method. In particular, the functions in the
:mod:`cmath` module will now accept objects with this method.
This is a backport of a Python 3.0 change.
(Contributed by Mark Dickinson.)
.. % Patch #1675423
* Changes to the :class:`Exception` interface
as dictated by :pep:`352` continue to be made. For 2.6,
the :attr:`message` attribute is being deprecated in favor of the
:attr:`args` attribute.
* The :func:`compile` built-in function now accepts keyword arguments
as well as positional parameters. (Contributed by
XXX
.)
as well as positional parameters. (Contributed by
Thomas Wouters
.)
.. % Patch 1444529
...
...
@@ -487,17 +519,32 @@ complete list of changes, or look through the CVS logs for all the details.
fieldnames)` is a factory function that creates subclasses of the standard tuple
whose fields are accessible by name as well as index. For example::
var_type = collections.NamedTuple('variable',
'id name type size')
var = var_type(1, 'frequency', 'int', 4)
print var[0], var.id # Equivalent
print var[2], var.type # Equivalent
>>> var_type = collections.NamedTuple('variable',
... 'id name type size')
# Names are separated by spaces or commas.
# 'id, name, type, size' would also work.
>>> var_type.__fields__
('id', 'name', 'type', 'size')
>>> var = var_type(1, 'frequency', 'int', 4)
>>> print var[0], var.id # Equivalent
1 1
>>> print var[2], var.type # Equivalent
int int
>>> v2 = var.__replace__('name', 'amplitude')
>>> v2
variable(id=1, name='amplitude', type='int', size=4)
(Contributed by Raymond Hettinger.)
* The :mod:`ctypes` module now supports a :class:`c_bool` datatype
that represents the C99 ``bool`` type. (Contributed by David Remahl.)
.. % Patch 1649190
* A new method in the :mod:`curses` module: for a window, :meth:`chgat` changes
the display characters for a certain number of characters on a single line. ::
the display characters for a certain number of characters on a single line.
::
# Boldface text starting at y=0,x=21
# and affecting the rest of the line.
...
...
@@ -505,11 +552,33 @@ complete list of changes, or look through the CVS logs for all the details.
(Contributed by Fabian Kreutz.)
* The :mod:`decimal` module was updated to version 1.66 of
`the General Decimal Specification <http://www2.hursley.ibm.com/decimal/decarith.html>`__. New features
include some methods for some basic mathematical functions such as
:meth:`exp` and :meth:`log10`::
>>> Decimal(1).exp()
Decimal("2.718281828459045235360287471")
>>> Decimal("2.7182818").ln()
Decimal("0.9999999895305022877376682436")
>>> Decimal(1000).log10()
Decimal("3")
(Implemented by Facundo Batista and Mark Dickinson.)
* An optional ``timeout`` parameter was added to the
:class:`ftplib.FTP` class constructor as well as the :meth:`connect`
method, specifying a timeout measured in seconds. (Added by Facundo
Batista.)
* The :func:`reduce` built-in function is also available in the
:mod:`functools` module. In Python 3.0, the built-in is dropped and it's
only available from :mod:`functools`; currently there are no plans
to drop the built-in in the 2.x series. (Patched by
Christian Heimes.)
.. % Patch 1739906
* The :func:`glob.glob` function can now return Unicode filenames if
a Unicode path was used and Unicode filenames are matched within the directory.
...
...
@@ -548,7 +617,7 @@ complete list of changes, or look through the CVS logs for all the details.
.. % Patch #1490190
* The :func:`os.walk` function now has a
"followlinks"
parameter. If
* The :func:`os.walk` function now has a
``followlinks``
parameter. If
set to True, it will follow symlinks pointing to directories and
visit the directory's contents. For backward compatibility, the
parameter's default value is false. Note that the function can fall
...
...
@@ -574,10 +643,17 @@ complete list of changes, or look through the CVS logs for all the details.
On Windows, :func:`os.path.expandvars` will now expand environment variables
in the form "%var%", and "~user" will be expanded into the
user's home directory path. (Contributed by
XXX
.)
user's home directory path. (Contributed by
Josiah Carlson
.)
.. % Patch 957650
* The Python debugger provided by the :mod:`pdb` module
gained a new command: "run" restarts the Python program being debugged,
and can optionally take new command-line arguments for the program.
(Contributed by Rocky Bernstein.)
.. % Patch #1393667
* New functions in the :mod:`posix` module: :func:`chflags` and :func:`lchflags`
are wrappers for the corresponding system calls (where they're available).
Constants for the flag values are defined in the :mod:`stat` module; some
...
...
@@ -701,6 +777,17 @@ complete list of changes, or look through the CVS logs for all the details.
(Added by Facundo Batista.)
* The XML-RPC classes :class:`SimpleXMLRPCServer` and :class:`DocXMLRPCServer`
classes can now be preventing from immediately opening and binding to
their socket by passing True as the ``bind_and_activate``
constructor parameter. This can be used to modify the instance's
:attr:`allow_reuse_address` attribute before calling the
:meth:`server_bind` and :meth:`server_activate` methods to
open the socket and begin listening for connections.
(Contributed by Peter Parente.)
.. % Patch 1599845
.. % ======================================================================
.. % whole new modules get described in \subsections here
...
...
@@ -712,7 +799,7 @@ Build and C API Changes
Changes to Python's build process and to the C API include:
* Detailed changes
ar
e listed here.
* Detailed changes
will b
e listed here.
.. % ======================================================================
...
...
@@ -737,7 +824,7 @@ are likely to be underestimates.
Some of the more notable changes are:
* Details go here.
* Details
will
go here.
.. % ======================================================================
...
...
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