@@ -344,8 +344,8 @@ aspects that are visible to the programmer:
344
344
345
345
* The :mod: `importlib.abc ` module has been updated with new :term: `abstract base
346
346
classes <abstract base class> ` for loading bytecode files. The obsolete
347
- ABCs, :class: `~importlib.abc. PyLoader ` and
348
- :class: `~importlib.abc. PyPycLoader `, have been deprecated (instructions on how
347
+ ABCs, :class: `! PyLoader ` and
348
+ :class: `! PyPycLoader `, have been deprecated (instructions on how
349
349
to stay Python 3.1 compatible are included with the documentation).
350
350
351
351
.. seealso ::
@@ -401,7 +401,7 @@ The *native strings* are always of type :class:`str` but are restricted to code
401
401
points between *U+0000 * through *U+00FF * which are translatable to bytes using
402
402
*Latin-1 * encoding. These strings are used for the keys and values in the
403
403
environment dictionary and for response headers and statuses in the
404
- :func: `start_response ` function. They must follow :rfc: `2616 ` with respect to
404
+ :func: `! start_response ` function. They must follow :rfc: `2616 ` with respect to
405
405
encoding. That is, they must either be *ISO-8859-1 * characters or use
406
406
:rfc: `2047 ` MIME encoding.
407
407
@@ -415,8 +415,8 @@ points:
415
415
encoded in utf-8 was using ``h.encode('utf-8') `` now needs to convert from
416
416
bytes to native strings using ``h.encode('utf-8').decode('latin-1') ``.
417
417
418
- * Values yielded by an application or sent using the :meth: `write ` method
419
- must be byte strings. The :func: `start_response ` function and environ
418
+ * Values yielded by an application or sent using the :meth: `! write ` method
419
+ must be byte strings. The :func: `! start_response ` function and environ
420
420
must use native strings. The two cannot be mixed.
421
421
422
422
For server implementers writing CGI-to-WSGI pathways or other CGI-style
@@ -499,7 +499,7 @@ Some smaller changes made to the core Python language are:
499
499
500
500
* The :func: `hasattr ` function works by calling :func: `getattr ` and detecting
501
501
whether an exception is raised. This technique allows it to detect methods
502
- created dynamically by :meth: `__getattr__ ` or :meth: `__getattribute__ ` which
502
+ created dynamically by :meth: `~object. __getattr__ ` or :meth: `~object. __getattribute__ ` which
503
503
would otherwise be absent from the class dictionary. Formerly, *hasattr *
504
504
would catch any exception, possibly masking genuine errors. Now, *hasattr *
505
505
has been tightened to only catch :exc: `AttributeError ` and let other
@@ -620,7 +620,7 @@ Some smaller changes made to the core Python language are:
620
620
621
621
* :class: `range ` objects now support *index * and *count * methods. This is part
622
622
of an effort to make more objects fully implement the
623
- :class: `collections.Sequence ` :term: `abstract base class `. As a result, the
623
+ :class: `collections.Sequence <collections.abc.Sequence> ` :term: `abstract base class `. As a result, the
624
624
language will have a more uniform API. In addition, :class: `range ` objects
625
625
now support slicing and negative indices, even with values larger than
626
626
:data: `sys.maxsize `. This makes *range * more interoperable with lists::
@@ -720,7 +720,7 @@ format.
720
720
elementtree
721
721
-----------
722
722
723
- The :mod: `xml.etree.ElementTree ` package and its :mod: `xml.etree.cElementTree `
723
+ The :mod: `xml.etree.ElementTree ` package and its :mod: `! xml.etree.cElementTree `
724
724
counterpart have been updated to version 1.3.
725
725
726
726
Several new and useful functions and methods have been added:
@@ -1008,13 +1008,13 @@ datetime and time
1008
1008
after 1900. The new supported year range is from 1000 to 9999 inclusive.
1009
1009
1010
1010
* Whenever a two-digit year is used in a time tuple, the interpretation has been
1011
- governed by :data: `time.accept2dyear `. The default is ``True `` which means that
1011
+ governed by :data: `! time.accept2dyear `. The default is ``True `` which means that
1012
1012
for a two-digit year, the century is guessed according to the POSIX rules
1013
1013
governing the ``%y `` strptime format.
1014
1014
1015
1015
Starting with Py3.2, use of the century guessing heuristic will emit a
1016
1016
:exc: `DeprecationWarning `. Instead, it is recommended that
1017
- :data: `time.accept2dyear ` be set to ``False `` so that large date ranges
1017
+ :data: `! time.accept2dyear ` be set to ``False `` so that large date ranges
1018
1018
can be used without guesswork::
1019
1019
1020
1020
>>> import time, warnings
@@ -1032,7 +1032,7 @@ datetime and time
1032
1032
'Fri Jan 1 12:34:56 11'
1033
1033
1034
1034
Several functions now have significantly expanded date ranges. When
1035
- :data: `time.accept2dyear ` is false, the :func: `time.asctime ` function will
1035
+ :data: `! time.accept2dyear ` is false, the :func: `time.asctime ` function will
1036
1036
accept any year that fits in a C int, while the :func: `time.mktime ` and
1037
1037
:func: `time.strftime ` functions will accept the full range supported by the
1038
1038
corresponding operating system functions.
@@ -1148,15 +1148,15 @@ for slice notation are well-suited to in-place editing::
1148
1148
reprlib
1149
1149
-------
1150
1150
1151
- When writing a :meth: `__repr__ ` method for a custom container, it is easy to
1151
+ When writing a :meth: `~object. __repr__ ` method for a custom container, it is easy to
1152
1152
forget to handle the case where a member refers back to the container itself.
1153
1153
Python's builtin objects such as :class: `list ` and :class: `set ` handle
1154
1154
self-reference by displaying "..." in the recursive part of the representation
1155
1155
string.
1156
1156
1157
- To help write such :meth: `__repr__ ` methods, the :mod: `reprlib ` module has a new
1157
+ To help write such :meth: `~object. __repr__ ` methods, the :mod: `reprlib ` module has a new
1158
1158
decorator, :func: `~reprlib.recursive_repr `, for detecting recursive calls to
1159
- :meth: `__repr__ ` and substituting a placeholder string instead::
1159
+ :meth: `! __repr__ ` and substituting a placeholder string instead::
1160
1160
1161
1161
>>> class MyList(list):
1162
1162
... @recursive_repr()
@@ -1308,7 +1308,7 @@ used for the imaginary part of a number:
1308
1308
>>> sys.hash_info # doctest: +SKIP
1309
1309
sys.hash_info(width=64, modulus=2305843009213693951, inf=314159, nan=0, imag=1000003)
1310
1310
1311
- An early decision to limit the inter-operability of various numeric types has
1311
+ An early decision to limit the interoperability of various numeric types has
1312
1312
been relaxed. It is still unsupported (and ill-advised) to have implicit
1313
1313
mixing in arithmetic expressions such as ``Decimal('1.1') + float('1.1') ``
1314
1314
because the latter loses information in the process of constructing the binary
@@ -1336,7 +1336,7 @@ Decimal('1.100000000000000088817841970012523233890533447265625')
1336
1336
Fraction(2476979795053773, 2251799813685248)
1337
1337
1338
1338
Another useful change for the :mod: `decimal ` module is that the
1339
- :attr: `Context.clamp ` attribute is now public. This is useful in creating
1339
+ :attr: `Context.clamp <decimal.Context.clamp> ` attribute is now public. This is useful in creating
1340
1340
contexts that correspond to the decimal interchange formats specified in IEEE
1341
1341
754 (see :issue: `8540 `).
1342
1342
@@ -1428,7 +1428,7 @@ before compressing and decompressing:
1428
1428
Aides and Brian Curtin in :issue: `9962 `, :issue: `1675951 `, :issue: `7471 ` and
1429
1429
:issue: `2846 `.)
1430
1430
1431
- Also, the :class: `zipfile.ZipExtFile ` class was reworked internally to represent
1431
+ Also, the :class: `zipfile.ZipExtFile <zipfile.ZipFile.open> ` class was reworked internally to represent
1432
1432
files stored inside an archive. The new implementation is significantly faster
1433
1433
and can be wrapped in an :class: `io.BufferedReader ` object for more speedups. It
1434
1434
also solves an issue where interleaved calls to *read * and *readline * gave the
@@ -1596,7 +1596,7 @@ sqlite3
1596
1596
1597
1597
The :mod: `sqlite3 ` module was updated to pysqlite version 2.6.0. It has two new capabilities.
1598
1598
1599
- * The :attr: `sqlite3.Connection.in_transit ` attribute is true if there is an
1599
+ * The :attr: `! sqlite3.Connection.in_transit ` attribute is true if there is an
1600
1600
active transaction for uncommitted changes.
1601
1601
1602
1602
* The :meth: `sqlite3.Connection.enable_load_extension ` and
@@ -1643,11 +1643,11 @@ for secure (encrypted, authenticated) internet connections:
1643
1643
other options. It includes a :meth: `~ssl.SSLContext.wrap_socket ` for creating
1644
1644
an SSL socket from an SSL context.
1645
1645
1646
- * A new function, :func: `ssl.match_hostname `, supports server identity
1646
+ * A new function, :func: `! ssl.match_hostname `, supports server identity
1647
1647
verification for higher-level protocols by implementing the rules of HTTPS
1648
1648
(from :rfc: `2818 `) which are also suitable for other protocols.
1649
1649
1650
- * The :func: `ssl.wrap_socket ` constructor function now takes a *ciphers *
1650
+ * The :func: `ssl.wrap_socket() <ssl.SSLContext.wrap_socket> ` constructor function now takes a *ciphers *
1651
1651
argument. The *ciphers * string lists the allowed encryption algorithms using
1652
1652
the format described in the `OpenSSL documentation
1653
1653
<https://www.openssl.org/docs/man1.0.2/man1/ciphers.html#CIPHER-LIST-FORMAT> `__.
@@ -1759,7 +1759,7 @@ names.
1759
1759
(Contributed by Michael Foord.)
1760
1760
1761
1761
* Experimentation at the interactive prompt is now easier because the
1762
- :class: `unittest.case. TestCase ` class can now be instantiated without
1762
+ :class: `unittest.TestCase ` class can now be instantiated without
1763
1763
arguments:
1764
1764
1765
1765
>>> from unittest import TestCase
@@ -1797,7 +1797,7 @@ names.
1797
1797
* In addition, the method names in the module have undergone a number of clean-ups.
1798
1798
1799
1799
For example, :meth: `~unittest.TestCase.assertRegex ` is the new name for
1800
- :meth: `~unittest.TestCase. assertRegexpMatches ` which was misnamed because the
1800
+ :meth: `! assertRegexpMatches ` which was misnamed because the
1801
1801
test uses :func: `re.search `, not :func: `re.match `. Other methods using
1802
1802
regular expressions are now named using short form "Regex" in preference to
1803
1803
"Regexp" -- this matches the names used in other unittest implementations,
@@ -1812,19 +1812,19 @@ names.
1812
1812
=============================== ==============================
1813
1813
Old Name Preferred Name
1814
1814
=============================== ==============================
1815
- :meth: `assert_ ` :meth: `.assertTrue `
1816
- :meth: `assertEquals ` :meth: `.assertEqual `
1817
- :meth: `assertNotEquals ` :meth: `.assertNotEqual `
1818
- :meth: `assertAlmostEquals ` :meth: `.assertAlmostEqual `
1819
- :meth: `assertNotAlmostEquals ` :meth: `.assertNotAlmostEqual `
1815
+ :meth: `! assert_ ` :meth: `.assertTrue `
1816
+ :meth: `! assertEquals ` :meth: `.assertEqual `
1817
+ :meth: `! assertNotEquals ` :meth: `.assertNotEqual `
1818
+ :meth: `! assertAlmostEquals ` :meth: `.assertAlmostEqual `
1819
+ :meth: `! assertNotAlmostEquals ` :meth: `.assertNotAlmostEqual `
1820
1820
=============================== ==============================
1821
1821
1822
1822
Likewise, the ``TestCase.fail* `` methods deprecated in Python 3.1 are expected
1823
1823
to be removed in Python 3.3.
1824
1824
1825
1825
(Contributed by Ezio Melotti; :issue: `9424 `.)
1826
1826
1827
- * The :meth: `~unittest.TestCase. assertDictContainsSubset ` method was deprecated
1827
+ * The :meth: `! assertDictContainsSubset ` method was deprecated
1828
1828
because it was misimplemented with the arguments in the wrong order. This
1829
1829
created hard-to-debug optical illusions where tests like
1830
1830
``TestCase().assertDictContainsSubset({'a':1, 'b':2}, {'a':1}) `` would fail.
@@ -1997,7 +1997,7 @@ under-the-hood.
1997
1997
dbm
1998
1998
---
1999
1999
2000
- All database modules now support the :meth: `get ` and :meth: `setdefault ` methods.
2000
+ All database modules now support the :meth: `! get ` and :meth: `! setdefault ` methods.
2001
2001
2002
2002
(Suggested by Ray Allen in :issue: `9523 `.)
2003
2003
@@ -2118,7 +2118,7 @@ The :mod:`pdb` debugger module gained a number of usability improvements:
2118
2118
:file: `.pdbrc ` script file.
2119
2119
* A :file: `.pdbrc ` script file can contain ``continue `` and ``next `` commands
2120
2120
that continue debugging.
2121
- * The :class: `Pdb ` class constructor now accepts a *nosigint * argument.
2121
+ * The :class: `~pdb. Pdb ` class constructor now accepts a *nosigint * argument.
2122
2122
* New commands: ``l(list) ``, ``ll(long list) `` and ``source `` for
2123
2123
listing source code.
2124
2124
* New commands: ``display `` and ``undisplay `` for showing or hiding
@@ -2394,11 +2394,11 @@ A number of small performance enhancements have been added:
2394
2394
2395
2395
(Contributed by Antoine Pitrou; :issue: `3001 `.)
2396
2396
2397
- * The fast-search algorithm in stringlib is now used by the :meth: `split `,
2398
- :meth: `rsplit `, :meth: `splitlines ` and :meth: `replace ` methods on
2397
+ * The fast-search algorithm in stringlib is now used by the :meth: `~str. split `,
2398
+ :meth: `~str. rsplit `, :meth: `~str. splitlines ` and :meth: `~str. replace ` methods on
2399
2399
:class: `bytes `, :class: `bytearray ` and :class: `str ` objects. Likewise, the
2400
- algorithm is also used by :meth: `rfind `, :meth: `rindex `, :meth: `rsplit ` and
2401
- :meth: `rpartition `.
2400
+ algorithm is also used by :meth: `~str. rfind `, :meth: `~str. rindex `, :meth: `~str. rsplit ` and
2401
+ :meth: `~str. rpartition `.
2402
2402
2403
2403
(Patch by Florent Xicluna in :issue: `7622 ` and :issue: `7462 `.)
2404
2404
@@ -2410,8 +2410,8 @@ A number of small performance enhancements have been added:
2410
2410
2411
2411
There were several other minor optimizations. Set differencing now runs faster
2412
2412
when one operand is much larger than the other (patch by Andress Bennetts in
2413
- :issue: `8685 `). The :meth: `array.repeat ` method has a faster implementation
2414
- (:issue: `1569291 ` by Alexander Belopolsky). The :class: `BaseHTTPRequestHandler `
2413
+ :issue: `8685 `). The :meth: `! array.repeat ` method has a faster implementation
2414
+ (:issue: `1569291 ` by Alexander Belopolsky). The :class: `~http.server. BaseHTTPRequestHandler `
2415
2415
has more efficient buffering (:issue: `3709 ` by Andrew Schaaf). The
2416
2416
:func: `operator.attrgetter ` function has been sped-up (:issue: `10160 ` by
2417
2417
Christos Georgiou). And :class: `~configparser.ConfigParser ` loads multi-line arguments a bit
@@ -2562,11 +2562,11 @@ Changes to Python's build process and to the C API include:
2562
2562
(Suggested by Raymond Hettinger and implemented by Benjamin Peterson;
2563
2563
:issue: `9778 `.)
2564
2564
2565
- * A new macro :c:macro: `Py_VA_COPY ` copies the state of the variable argument
2565
+ * A new macro :c:macro: `! Py_VA_COPY ` copies the state of the variable argument
2566
2566
list. It is equivalent to C99 *va_copy * but available on all Python platforms
2567
2567
(:issue: `2443 `).
2568
2568
2569
- * A new C API function :c:func: `PySys_SetArgvEx ` allows an embedded interpreter
2569
+ * A new C API function :c:func: `! PySys_SetArgvEx ` allows an embedded interpreter
2570
2570
to set :data: `sys.argv ` without also modifying :data: `sys.path `
2571
2571
(:issue: `5753 `).
2572
2572
@@ -2650,8 +2650,9 @@ require changes to your code:
2650
2650
* :class: `bytearray ` objects can no longer be used as filenames; instead,
2651
2651
they should be converted to :class: `bytes `.
2652
2652
2653
- * The :meth: `array.tostring ` and :meth: `array.fromstring ` have been renamed to
2654
- :meth: `array.tobytes ` and :meth: `array.frombytes ` for clarity. The old names
2653
+ * The :meth: `!array.tostring ` and :meth: `!array.fromstring ` have been renamed to
2654
+ :meth: `array.tobytes() <array.array.tobytes> ` and
2655
+ :meth: `array.frombytes() <array.array.frombytes> ` for clarity. The old names
2655
2656
have been deprecated. (See :issue: `8990 `.)
2656
2657
2657
2658
* ``PyArg_Parse*() `` functions:
@@ -2664,15 +2665,15 @@ require changes to your code:
2664
2665
instead; the new type has a well-defined interface for passing typing safety
2665
2666
information and a less complicated signature for calling a destructor.
2666
2667
2667
- * The :func: `sys.setfilesystemencoding ` function was removed because
2668
+ * The :func: `! sys.setfilesystemencoding ` function was removed because
2668
2669
it had a flawed design.
2669
2670
2670
2671
* The :func: `random.seed ` function and method now salt string seeds with an
2671
2672
sha512 hash function. To access the previous version of *seed * in order to
2672
2673
reproduce Python 3.1 sequences, set the *version * argument to *1 *,
2673
2674
``random.seed(s, version=1) ``.
2674
2675
2675
- * The previously deprecated :func: `string.maketrans ` function has been removed
2676
+ * The previously deprecated :func: `! string.maketrans ` function has been removed
2676
2677
in favor of the static methods :meth: `bytes.maketrans ` and
2677
2678
:meth: `bytearray.maketrans `. This change solves the confusion around which
2678
2679
types were supported by the :mod: `string ` module. Now, :class: `str `,
0 commit comments