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