Skip to content

Commit b87a443

Browse files
miss-islingtonhugovkAlexWaygood
authored
[3.11] gh-101100: Fix Sphinx warnings in whatsnew/3.2.rst (GH-115580) (#115590)
Co-authored-by: Hugo van Kemenade <[email protected]> Co-authored-by: Alex Waygood <[email protected]>
1 parent 5dac9c5 commit b87a443

File tree

5 files changed

+96
-43
lines changed

5 files changed

+96
-43
lines changed

Doc/c-api/hash.rst

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
.. highlight:: c
2+
3+
PyHash API
4+
----------
5+
6+
See also the :c:member:`PyTypeObject.tp_hash` member.
7+
8+
.. c:type:: Py_hash_t
9+
10+
Hash value type: signed integer.
11+
12+
.. versionadded:: 3.2
13+
14+
.. c:type:: Py_uhash_t
15+
16+
Hash value type: unsigned integer.
17+
18+
.. versionadded:: 3.2
19+
20+
21+
.. c:type:: PyHash_FuncDef
22+
23+
Hash function definition used by :c:func:`PyHash_GetFuncDef`.
24+
25+
.. c::member:: Py_hash_t (*const hash)(const void *, Py_ssize_t)
26+
27+
Hash function.
28+
29+
.. c:member:: const char *name
30+
31+
Hash function name (UTF-8 encoded string).
32+
33+
.. c:member:: const int hash_bits
34+
35+
Internal size of the hash value in bits.
36+
37+
.. c:member:: const int seed_bits
38+
39+
Size of seed input in bits.
40+
41+
.. versionadded:: 3.4
42+
43+
44+
.. c:function:: PyHash_FuncDef* PyHash_GetFuncDef(void)
45+
46+
Get the hash function definition.
47+
48+
.. seealso::
49+
:pep:`456` "Secure and interchangeable hash algorithm".
50+
51+
.. versionadded:: 3.4

Doc/c-api/utilities.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ and parsing function arguments and constructing Python values from C values.
1717
marshal.rst
1818
arg.rst
1919
conversion.rst
20+
hash.rst
2021
reflection.rst
2122
codec.rst

Doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@
251251
('py:attr', '__annotations__'),
252252
('py:meth', '__missing__'),
253253
('py:attr', '__wrapped__'),
254+
('py:attr', 'decimal.Context.clamp'),
254255
('py:meth', 'index'), # list.index, tuple.index, etc.
255256
]
256257

Doc/tools/.nitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ Doc/whatsnew/2.5.rst
9191
Doc/whatsnew/2.6.rst
9292
Doc/whatsnew/2.7.rst
9393
Doc/whatsnew/3.0.rst
94-
Doc/whatsnew/3.2.rst
9594
Doc/whatsnew/3.3.rst
9695
Doc/whatsnew/3.4.rst
9796
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
@@ -497,7 +497,7 @@ Some smaller changes made to the core Python language are:
497497

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

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

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

724724
Several new and useful functions and methods have been added:
@@ -1006,13 +1006,13 @@ datetime and time
10061006
after 1900. The new supported year range is from 1000 to 9999 inclusive.
10071007

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

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

10181018
>>> import time, warnings
@@ -1030,7 +1030,7 @@ datetime and time
10301030
'Fri Jan 1 12:34:56 11'
10311031

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

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

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

11591159
>>> class MyList(list):
11601160
... @recursive_repr()
@@ -1306,7 +1306,7 @@ used for the imaginary part of a number:
13061306
>>> sys.hash_info # doctest: +SKIP
13071307
sys.hash_info(width=64, modulus=2305843009213693951, inf=314159, nan=0, imag=1000003)
13081308

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
13101310
been relaxed. It is still unsupported (and ill-advised) to have implicit
13111311
mixing in arithmetic expressions such as ``Decimal('1.1') + float('1.1')``
13121312
because the latter loses information in the process of constructing the binary
@@ -1334,7 +1334,7 @@ Decimal('1.100000000000000088817841970012523233890533447265625')
13341334
Fraction(2476979795053773, 2251799813685248)
13351335

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

@@ -1426,7 +1426,7 @@ before compressing and decompressing:
14261426
Aides and Brian Curtin in :issue:`9962`, :issue:`1675951`, :issue:`7471` and
14271427
:issue:`2846`.)
14281428

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

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

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
15981598
active transaction for uncommitted changes.
15991599

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

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

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

17591759
* 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
17611761
arguments:
17621762

17631763
>>> from unittest import TestCase
@@ -1795,7 +1795,7 @@ names.
17951795
* In addition, the method names in the module have undergone a number of clean-ups.
17961796

17971797
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
17991799
test uses :func:`re.search`, not :func:`re.match`. Other methods using
18001800
regular expressions are now named using short form "Regex" in preference to
18011801
"Regexp" -- this matches the names used in other unittest implementations,
@@ -1810,11 +1810,11 @@ names.
18101810
=============================== ==============================
18111811
Old Name Preferred Name
18121812
=============================== ==============================
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`
18181818
=============================== ==============================
18191819

18201820
Likewise, the ``TestCase.fail*`` methods deprecated in Python 3.1 are expected
@@ -1823,7 +1823,7 @@ names.
18231823

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

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

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

20002000
(Suggested by Ray Allen in :issue:`9523`.)
20012001

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

23932393
(Contributed by Antoine Pitrou; :issue:`3001`.)
23942394

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
23972397
: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`.
24002400

24012401
(Patch by Florent Xicluna in :issue:`7622` and :issue:`7462`.)
24022402

@@ -2408,8 +2408,8 @@ A number of small performance enhancements have been added:
24082408

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

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

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

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

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

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

2665-
* The :func:`sys.setfilesystemencoding` function was removed because
2666+
* The :func:`!sys.setfilesystemencoding` function was removed because
26662667
it had a flawed design.
26672668

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

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

0 commit comments

Comments
 (0)