Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4dff48d

Browse files
gh-101100: Fix Sphinx warnings inwhatsnew/3.2.rst (#115580)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
1 parent30fce5f commit4dff48d

File tree

3 files changed

+44
-43
lines changed

3 files changed

+44
-43
lines changed

‎Doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@
275275
('py:attr','__annotations__'),
276276
('py:meth','__missing__'),
277277
('py:attr','__wrapped__'),
278+
('py:attr','decimal.Context.clamp'),
278279
('py:meth','index'),# list.index, tuple.index, etc.
279280
]
280281

‎Doc/tools/.nitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ Doc/whatsnew/2.5.rst
8686
Doc/whatsnew/2.6.rst
8787
Doc/whatsnew/2.7.rst
8888
Doc/whatsnew/3.0.rst
89-
Doc/whatsnew/3.2.rst
9089
Doc/whatsnew/3.3.rst
9190
Doc/whatsnew/3.4.rst
9291
Doc/whatsnew/3.5.rst

‎Doc/whatsnew/3.2.rst

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ aspects that are visible to the programmer:
344344

345345
* The:mod:`importlib.abc` module has been updated with new:term:`abstract base
346346
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
349349
to stay Python 3.1 compatible are included with the documentation).
350350

351351
..seealso::
@@ -401,7 +401,7 @@ The *native strings* are always of type :class:`str` but are restricted to code
401401
points between *U+0000* through *U+00FF* which are translatable to bytes using
402402
*Latin-1* encoding. These strings are used for the keys and values in the
403403
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
405405
encoding. That is, they must either be *ISO-8859-1* characters or use
406406
:rfc:`2047` MIME encoding.
407407

@@ -415,8 +415,8 @@ points:
415415
encoded in utf-8 was using ``h.encode('utf-8')`` now needs to convert from
416416
bytes to native strings using ``h.encode('utf-8').decode('latin-1')``.
417417

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
420420
must use native strings. The two cannot be mixed.
421421

422422
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:
499499

500500
* The:func:`hasattr` function works by calling:func:`getattr` and detecting
501501
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
503503
would otherwise be absent from the class dictionary. Formerly, *hasattr*
504504
would catch any exception, possibly masking genuine errors. Now, *hasattr*
505505
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:
620620

621621
*:class:`range` objects now support *index* and *count* methods. This is part
622622
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
624624
language will have a more uniform API. In addition,:class:`range` objects
625625
now support slicing and negative indices, even with values larger than
626626
:data:`sys.maxsize`. This makes *range* more interoperable with lists::
@@ -720,7 +720,7 @@ format.
720720
elementtree
721721
-----------
722722

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`
724724
counterpart have been updated to version 1.3.
725725

726726
Several new and useful functions and methods have been added:
@@ -1008,13 +1008,13 @@ datetime and time
10081008
after 1900. The new supported year range is from 1000 to 9999 inclusive.
10091009

10101010
* 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
10121012
for a two-digit year, the century is guessed according to the POSIX rules
10131013
governing the ``%y`` strptime format.
10141014

10151015
Starting with Py3.2, use of the century guessing heuristic will emit a
10161016
: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
10181018
can be used without guesswork::
10191019

10201020
>>> import time, warnings
@@ -1032,7 +1032,7 @@ datetime and time
10321032
'Fri Jan 1 12:34:56 11'
10331033

10341034
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
10361036
accept any year that fits in a C int, while the:func:`time.mktime` and
10371037
:func:`time.strftime` functions will accept the full range supported by the
10381038
corresponding operating system functions.
@@ -1148,15 +1148,15 @@ for slice notation are well-suited to in-place editing::
11481148
reprlib
11491149
-------
11501150

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
11521152
forget to handle the case where a member refers back to the container itself.
11531153
Python's builtin objects such as:class:`list` and:class:`set` handle
11541154
self-reference by displaying "..." in the recursive part of the representation
11551155
string.
11561156

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
11581158
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::
11601160

11611161
>>> class MyList(list):
11621162
... @recursive_repr()
@@ -1308,7 +1308,7 @@ used for the imaginary part of a number:
13081308
>>>sys.hash_info# doctest: +SKIP
13091309
sys.hash_info(width=64, modulus=2305843009213693951, inf=314159, nan=0, imag=1000003)
13101310

1311-
An early decision to limit theinter-operability of various numeric types has
1311+
An early decision to limit theinteroperability of various numeric types has
13121312
been relaxed. It is still unsupported (and ill-advised) to have implicit
13131313
mixing in arithmetic expressions such as ``Decimal('1.1') + float('1.1')``
13141314
because the latter loses information in the process of constructing the binary
@@ -1336,7 +1336,7 @@ Decimal('1.100000000000000088817841970012523233890533447265625')
13361336
Fraction(2476979795053773, 2251799813685248)
13371337

13381338
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
13401340
contexts that correspond to the decimal interchange formats specified in IEEE
13411341
754 (see:issue:`8540`).
13421342

@@ -1428,7 +1428,7 @@ before compressing and decompressing:
14281428
Aides and Brian Curtin in:issue:`9962`,:issue:`1675951`,:issue:`7471` and
14291429
:issue:`2846`.)
14301430

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
14321432
files stored inside an archive. The new implementation is significantly faster
14331433
and can be wrapped in an:class:`io.BufferedReader` object for more speedups. It
14341434
also solves an issue where interleaved calls to *read* and *readline* gave the
@@ -1596,7 +1596,7 @@ sqlite3
15961596

15971597
The:mod:`sqlite3` module was updated to pysqlite version 2.6.0. It has two new capabilities.
15981598

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
16001600
active transaction for uncommitted changes.
16011601

16021602
* The:meth:`sqlite3.Connection.enable_load_extension` and
@@ -1643,11 +1643,11 @@ for secure (encrypted, authenticated) internet connections:
16431643
other options. It includes a:meth:`~ssl.SSLContext.wrap_socket` for creating
16441644
an SSL socket from an SSL context.
16451645

1646-
* A new function,:func:`ssl.match_hostname`, supports server identity
1646+
* A new function,:func:`!ssl.match_hostname`, supports server identity
16471647
verification for higher-level protocols by implementing the rules of HTTPS
16481648
(from:rfc:`2818`) which are also suitable for other protocols.
16491649

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*
16511651
argument. The *ciphers* string lists the allowed encryption algorithms using
16521652
the format described in the `OpenSSL documentation
16531653
<https://www.openssl.org/docs/man1.0.2/man1/ciphers.html#CIPHER-LIST-FORMAT>`__.
@@ -1759,7 +1759,7 @@ names.
17591759
(Contributed by Michael Foord.)
17601760

17611761
* 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
17631763
arguments:
17641764

17651765
>>>from unittestimport TestCase
@@ -1797,7 +1797,7 @@ names.
17971797
* In addition, the method names in the module have undergone a number of clean-ups.
17981798

17991799
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
18011801
test uses:func:`re.search`, not:func:`re.match`. Other methods using
18021802
regular expressions are now named using short form "Regex" in preference to
18031803
"Regexp" -- this matches the names used in other unittest implementations,
@@ -1812,19 +1812,19 @@ names.
18121812
=============================== ==============================
18131813
Old Name Preferred Name
18141814
=============================== ==============================
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`
18201820
=============================== ==============================
18211821

18221822
Likewise, the ``TestCase.fail*`` methods deprecated in Python 3.1 are expected
18231823
to be removed in Python 3.3.
18241824

18251825
(Contributed by Ezio Melotti;:issue:`9424`.)
18261826

1827-
* The:meth:`~unittest.TestCase.assertDictContainsSubset` method was deprecated
1827+
* The:meth:`!assertDictContainsSubset` method was deprecated
18281828
because it was misimplemented with the arguments in the wrong order. This
18291829
created hard-to-debug optical illusions where tests like
18301830
``TestCase().assertDictContainsSubset({'a':1, 'b':2}, {'a':1})`` would fail.
@@ -1997,7 +1997,7 @@ under-the-hood.
19971997
dbm
19981998
---
19991999

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.
20012001

20022002
(Suggested by Ray Allen in:issue:`9523`.)
20032003

@@ -2118,7 +2118,7 @@ The :mod:`pdb` debugger module gained a number of usability improvements:
21182118
:file:`.pdbrc` script file.
21192119
* A:file:`.pdbrc` script file can contain ``continue`` and ``next`` commands
21202120
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.
21222122
* New commands: ``l(list)``, ``ll(long list)`` and ``source`` for
21232123
listing source code.
21242124
* New commands: ``display`` and ``undisplay`` for showing or hiding
@@ -2394,11 +2394,11 @@ A number of small performance enhancements have been added:
23942394

23952395
(Contributed by Antoine Pitrou;:issue:`3001`.)
23962396

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
23992399
: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`.
24022402

24032403
(Patch by Florent Xicluna in:issue:`7622` and:issue:`7462`.)
24042404

@@ -2410,8 +2410,8 @@ A number of small performance enhancements have been added:
24102410

24112411
There were several other minor optimizations. Set differencing now runs faster
24122412
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`
24152415
has more efficient buffering (:issue:`3709` by Andrew Schaaf). The
24162416
:func:`operator.attrgetter` function has been sped-up (:issue:`10160` by
24172417
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:
25622562
(Suggested by Raymond Hettinger and implemented by Benjamin Peterson;
25632563
:issue:`9778`.)
25642564

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
25662566
list. It is equivalent to C99 *va_copy* but available on all Python platforms
25672567
(:issue:`2443`).
25682568

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
25702570
to set:data:`sys.argv` without also modifying:data:`sys.path`
25712571
(:issue:`5753`).
25722572

@@ -2650,8 +2650,9 @@ require changes to your code:
26502650
*:class:`bytearray` objects can no longer be used as filenames; instead,
26512651
they should be converted to:class:`bytes`.
26522652

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
26552656
have been deprecated. (See:issue:`8990`.)
26562657

26572658
* ``PyArg_Parse*()`` functions:
@@ -2664,15 +2665,15 @@ require changes to your code:
26642665
instead; the new type has a well-defined interface for passing typing safety
26652666
information and a less complicated signature for calling a destructor.
26662667

2667-
* The:func:`sys.setfilesystemencoding` function was removed because
2668+
* The:func:`!sys.setfilesystemencoding` function was removed because
26682669
it had a flawed design.
26692670

26702671
* The:func:`random.seed` function and method now salt string seeds with an
26712672
sha512 hash function. To access the previous version of *seed* in order to
26722673
reproduce Python 3.1 sequences, set the *version* argument to *1*,
26732674
``random.seed(s, version=1)``.
26742675

2675-
* The previously deprecated:func:`string.maketrans` function has been removed
2676+
* The previously deprecated:func:`!string.maketrans` function has been removed
26762677
in favor of the static methods:meth:`bytes.maketrans` and
26772678
:meth:`bytearray.maketrans`. This change solves the confusion around which
26782679
types were supported by the:mod:`string` module. Now,:class:`str`,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp