Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 08388ef

Browse files
committed
Some textual tweaks, and fixed a few typos found by a spell checker.
1 parent b768d4f commit 08388ef

1 file changed

Lines changed: 39 additions & 26 deletions

File tree

Doc/whatsnew/3.0.rst

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,26 @@
5555
5656
This article explains the new features in Python 3.0, compared to 2.6.
5757
Python 3.0, also known as "Python 3000" or "Py3K", is the first ever
58-
*intentionally incompatible* release. There are more changes than in
59-
a typical release, and more that are important for all Python users.
60-
Nevertheless, after digesting the changes, you'll find that Python
61-
really hasn't changed all that much -- by and large, we're merely
62-
fixing well-known annoyances and warts.
58+
*intentionally backwards incompatible* Python release. There are more
59+
changes than in a typical release, and more that are important for all
60+
Python users. Nevertheless, after digesting the changes, you'll find
61+
that Python really hasn't changed all that much -- by and large, we're
62+
mostly fixing well-known annoyances and warts, and removing a lot of
63+
old cruft.
6364

6465
This article doesn't attempt to provide a complete specification of
65-
the new features, but instead provides a convenient overview. For
66-
full details, you should refer to the documentation for Python 3.0. If
67-
you want to understand the complete implementation and design
68-
rationale, refer to the PEP for a particular new feature.
66+
all new features, but instead tries to give a convenient overview.
67+
For full details, you should refer to the documentation for Python
68+
3.0, and/or the many PEPs referenced in the text. If you want to
69+
understand the complete implementation and design rationale for a
70+
particular feature, PEPs usually have more details than the regular
71+
documentation; but note that PEPs usually are not kept up-to-date once
72+
a feature has been fully implemented.
73+
74+
Due to time constraints this document is not as complete as it should
75+
have been. As always for a new release, the ``Misc/NEWS`` file in the
76+
source distribution contains a wealth of detailed information about
77+
every small thing that was changed.
6978

7079
.. Compare with previous release in 2 - 3 sentences here.
7180
.. add hyperlink when the documentation becomes available online.
@@ -144,11 +153,14 @@ Some well-known APIs no longer return lists:
144153
* Also, the :meth:`dict.iterkeys`, :meth:`dict.iteritems` and
145154
:meth:`dict.itervalues` methods are no longer supported.
146155

147-
* :func:`map` and :func:`filter` return iterators. A quick fix is e.g.
148-
``list(map(...))``, but a better fix is often to use a list
149-
comprehension (especially when the original code uses :keyword:`lambda`).
150-
Particularly tricky is :func:`map` invoked for the side effects of the
151-
function; the correct transformation is to use a for-loop.
156+
* :func:`map` and :func:`filter` return iterators. If you really need
157+
a list, a quick fix is e.g. ``list(map(...))``, but a better fix is
158+
often to use a list comprehension (especially when the original code
159+
uses :keyword:`lambda`), or rewriting the code so it doesn't need a
160+
list at all. Particularly tricky is :func:`map` invoked for the
161+
side effects of the function; the correct transformation is to use a
162+
regular :keyword:`for` loop (since creating a list would just be
163+
wasteful).
152164

153165
* :func:`range` now behaves like :func:`xrange` used to behave, except
154166
it works with values of arbitrary size. The latter no longer
@@ -164,13 +176,14 @@ Python 3.0 has simplified the rules for ordering comparisons:
164176
* The ordering comparison operators (``<``, ``<=``, ``>=``, ``>``)
165177
raise a TypeError exception when the operands don't have a
166178
meaningful natural ordering. Thus, expressions like ``1 < ''``, ``0
167-
> None`` or ``len <= len`` are no longer valid. A corollary is that
168-
sorting a heterogeneous list no longer makes sense -- all the
169-
elements must be comparable to each other. Note that this does not
170-
apply to the ``==`` and ``!=`` operators: objects of different
171-
uncomparable types always compare unequal to each other, and an
172-
object always compares equal to itself (i.e., ``x is y`` implies
173-
``x == y``; this is true even for *NaN*).
179+
> None`` or ``len <= len`` are no longer valid, and e.g. ``None <
180+
None`` raises :exc:`TypeError` instead of returning
181+
:keyword:`False`. A corollary is that sorting a heterogeneous list
182+
no longer makes sense -- all the elements must be comparable to each
183+
other. Note that this does not apply to the ``==`` and ``!=``
184+
operators: objects of different incomparable types always compare
185+
unequal to each other, and an object always compares equal to itself
186+
(i.e., ``x is y`` implies ``x == y``; this is true even for *NaN*).
174187

175188
* :meth:`builtin.sorted` and :meth:`list.sort` no longer accept the
176189
*cmp* argument providing a comparison function. Use the *key*
@@ -196,7 +209,7 @@ Integers
196209
existed for years, at least since Python 2.2.)
197210

198211
* The :data:`sys.maxint` constant was removed, since there is no
199-
longer a limit to the value of ints. However, :data:`sys.maxsize`
212+
longer a limit to the value of integers. However, :data:`sys.maxsize`
200213
can be used as an integer larger than any practical list or string
201214
index. It conforms to the implementation's "natural" integer size
202215
and is typically the same as :data:`sys.maxint` in previous releases
@@ -542,7 +555,7 @@ review:
542555

543556
* The :mod:`bsddb3` package was removed because its presence in the
544557
core standard library has proved over time to be a particular burden
545-
for the core developers due to testing instability and Berlekey DB's
558+
for the core developers due to testing instability and Berkeley DB's
546559
release schedule. However, the package is alive and well,
547560
externally maintained at http://www.jcea.es/programacion/pybsddb.htm.
548561

@@ -599,8 +612,8 @@ review:
599612

600613
* :mod:`xmlrpc` (:mod:`xmlrpclib`, :mod:`DocXMLRPCServer`,
601614
:mod:`SimpleXMLRPCServer`).
602-
603-
Some other changes to standard library moduled, not covered by
615+
modules
616+
Some other changes to standard library modules, not covered by
604617
:pep:`3108`:
605618

606619
* Killed :mod:`sets`. Use the builtin :func:`set` function.
@@ -840,7 +853,7 @@ to the C API.
840853
* Renamed the boolean conversion C-level slot and method:
841854
``nb_nonzero`` is now ``nb_bool``.
842855

843-
* Removed ``METH_OLDARGS`` and ``WITH_CYCLE_GC`` from the C API.
856+
* Removed :cmacro:`METH_OLDARGS` and :cmacro:`WITH_CYCLE_GC` from the C API.
844857

845858
.. ======================================================================
846859

0 commit comments

Comments
 (0)