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
4a98a2a5
Commit
4a98a2a5
authored
Nov 21, 2008
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A few tiny improvements that I had sitting in an edit buffer. More to come.
Much, much more. :-)
parent
d8ccd1ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
12 deletions
+31
-12
Doc/whatsnew/3.0.rst
Doc/whatsnew/3.0.rst
+31
-12
No files found.
Doc/whatsnew/3.0.rst
View file @
4a98a2a5
...
...
@@ -2,10 +2,14 @@
What's New in Python 3.0
****************************
.. XXX add trademark info for Apple, Microsoft, SourceForge.
:Author: Guido van Rossum
:Release: 0.1
:Release: |release|
:Date: |today|
.. Rules for maintenance:
.. $Id$
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
...
...
@@ -46,10 +50,10 @@
This saves the maintainer the effort of going through the SVN log
when researching a change.
This article explains the new features in Python 3.0, comparing to 2.6
(or in some cases 2.5, since 2.6 isn't released yet).
The best estimate for a release date is August
2008.
This article explains the new features in Python 3.0, comparing to 2.6
.
In some cases it will also summarize changes since 2.5, with a reference
to "What's New in Python 2.6" for the details. Python 2.6 was released
on October 1 2008. Python 3.0 will be released in December
2008.
This article doesn't attempt to provide a complete specification of
the new features, but instead provides a convenient overview. For
...
...
@@ -131,6 +135,17 @@ changes to rarely used features.)
that if a file is opened using an incorrect mode or encoding, I/O
will likely fail.
* The ordering comparison operators (``<``, ``<=``, ``>=``, ``>``)
raise a TypeError exception when the operands don't have a
meaningful natural ordering. Thus, expressions like ``1 < ''``, ``0
> None`` or ``len < len`` are no longer valid. A corollary is that
sorting a heterogeneous list no longer makes sense -- all the
elements must be comparable to each other. Note that this does not
apply to the ``==`` and ``!=`` operators: objects of different
uncomparable types always compare unequal to each other, and an
object always compares equal to itself (i.e., ``x is y`` implies ``x
= y``; this is true even for ``NaN``).
* :func:`map` and :func:`filter` return iterators. A quick fix is e.g.
``list(map(...))``, but a better fix is often to use a list
comprehension (especially when the original code uses :keyword:`lambda`).
...
...
@@ -147,6 +162,8 @@ changes to rarely used features.)
* ``1/2`` returns a float. Use ``1//2`` to get the truncating behavior.
.. XXX move the next one to a later point, it's not a common stumbling block.
* The :func:`repr` of a long integer doesn't include the trailing ``L``
anymore, so code that unconditionally strips that character will
chop off the last digit instead.
...
...
@@ -168,7 +185,7 @@ Strings and Bytes
or :meth:`bytes.decode` (bytes -> str) methods.
* All backslashes in raw strings are interpreted literally. This means that
Unicode escape
s are not treated specially.
``'\U'`` and ``'\u'`` escapes in raw string
s are not treated specially.
.. XXX add bytearray
...
...
@@ -186,16 +203,17 @@ Strings and Bytes
* The :mod:`StringIO` and :mod:`cStringIO` modules are gone. Instead, import
:class:`io.StringIO` or :class:`io.BytesIO`.
* ``'\U'`` and ``'\u'`` escapes in raw strings are not treated specially.
PEP 3101: A New Approach to String Formatting
=============================================
.. XXX expand this
* A new system for built-in string formatting operations replaces the
``%`` string formatting operator. (However, the ``%`` operator is
still supported; it will be deprecated in Python 3.1 and removed
from the language at some later time.)
* A new system for built-in string formatting operations replaces the ``%``
string formatting operator.
.. XXX expand this
PEP 3106: Revamping dict :meth:`dict.keys`, :meth:`dict.items` and :meth:`dict.values`
...
...
@@ -207,7 +225,8 @@ PEP 3106: Revamping dict :meth:`dict.keys`, :meth:`dict.items` and :meth:`dict.v
methods have been removed.
* :meth:`dict.keys`, :meth:`dict.values` and :meth:`dict.items` return objects
with set behavior that reference the underlying dict.
with set behavior that reference the underlying dict; these are often
referred to as *dictionary views*.
PEP 3107: Function Annotations
...
...
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