Skip to content

Commit 8bbbac8

Browse files
AA-Turnerhugovk
andauthored
GH-101100: Resolve reference warnings in whatsnew/3.5.rst (#138412)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent cfcfbdd commit 8bbbac8

File tree

3 files changed

+51
-44
lines changed

3 files changed

+51
-44
lines changed

Doc/library/collections.abc.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,17 @@ Collections Abstract Base Classes -- Detailed Descriptions
272272
linked list), the mixins will have quadratic performance and will
273273
likely need to be overridden.
274274

275-
.. versionchanged:: 3.5
276-
The index() method added support for *stop* and *start*
277-
arguments.
275+
.. method:: index(value, start=0, stop=None)
276+
277+
Return first index of *value*.
278+
279+
Raises :exc:`ValueError` if the value is not present.
280+
281+
Supporting the *start* and *stop* arguments is optional, but recommended.
282+
283+
.. versionchanged:: 3.5
284+
The :meth:`!index` method added support for *stop* and *start*
285+
arguments.
278286

279287
.. class:: Set
280288
MutableSet

Doc/tools/.nitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,4 @@ Doc/using/windows.rst
6060
Doc/whatsnew/2.4.rst
6161
Doc/whatsnew/2.5.rst
6262
Doc/whatsnew/2.6.rst
63-
Doc/whatsnew/3.5.rst
6463
Doc/whatsnew/3.10.rst

Doc/whatsnew/3.5.rst

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Coroutine functions are declared using the new :keyword:`async def` syntax::
181181
Inside a coroutine function, the new :keyword:`await` expression can be used
182182
to suspend coroutine execution until the result is available. Any object
183183
can be *awaited*, as long as it implements the :term:`awaitable` protocol by
184-
defining the :meth:`__await__` method.
184+
defining the :meth:`~object.__await__` method.
185185

186186
PEP 492 also adds :keyword:`async for` statement for convenient iteration
187187
over asynchronous iterables.
@@ -273,9 +273,10 @@ PEP 465 - A dedicated infix operator for matrix multiplication
273273

274274
:pep:`465` adds the ``@`` infix operator for matrix multiplication.
275275
Currently, no builtin Python types implement the new operator, however, it
276-
can be implemented by defining :meth:`__matmul__`, :meth:`__rmatmul__`,
277-
and :meth:`__imatmul__` for regular, reflected, and in-place matrix
278-
multiplication. The semantics of these methods is similar to that of
276+
can be implemented by defining :meth:`~object.__matmul__`,
277+
:meth:`~object.__rmatmul__`, and :meth:`~object.__imatmul__` for regular,
278+
reflected, and in-place matrix multiplication.
279+
The semantics of these methods is similar to that of
279280
methods defining other infix arithmetic operators.
280281

281282
Matrix multiplication is a notably common operation in many fields of
@@ -800,7 +801,7 @@ Notable changes in the :mod:`asyncio` module since Python 3.4.0:
800801
control.
801802
(Contributed by Victor Stinner.)
802803

803-
* The :func:`~asyncio.async` function is deprecated in favor of
804+
* The :func:`!async` function is deprecated in favor of
804805
:func:`~asyncio.ensure_future`.
805806
(Contributed by Yury Selivanov.)
806807

@@ -905,10 +906,8 @@ collections
905906
The :class:`~collections.OrderedDict` class is now implemented in C, which
906907
makes it 4 to 100 times faster. (Contributed by Eric Snow in :issue:`16991`.)
907908

908-
:meth:`OrderedDict.items() <collections.OrderedDict.items>`,
909-
:meth:`OrderedDict.keys() <collections.OrderedDict.keys>`,
910-
:meth:`OrderedDict.values() <collections.OrderedDict.values>` views now support
911-
:func:`reversed` iteration.
909+
:meth:`!OrderedDict.items`, :meth:`!OrderedDict.keys`,
910+
and :meth:`!OrderedDict.values` views now support :func:`reversed` iteration.
912911
(Contributed by Serhiy Storchaka in :issue:`19505`.)
913912

914913
The :class:`~collections.deque` class now defines
@@ -928,7 +927,7 @@ Docstrings produced by :func:`~collections.namedtuple` can now be updated::
928927
(Contributed by Berker Peksag in :issue:`24064`.)
929928

930929
The :class:`~collections.UserString` class now implements the
931-
:meth:`__getnewargs__`, :meth:`__rmod__`, :meth:`~str.casefold`,
930+
:meth:`~object.__getnewargs__`, :meth:`~object.__rmod__`, :meth:`~str.casefold`,
932931
:meth:`~str.format_map`, :meth:`~str.isprintable`, and :meth:`~str.maketrans`
933932
methods to match the corresponding methods of :class:`str`.
934933
(Contributed by Joe Jevnik in :issue:`22189`.)
@@ -937,7 +936,7 @@ methods to match the corresponding methods of :class:`str`.
937936
collections.abc
938937
---------------
939938

940-
The :meth:`Sequence.index() <collections.abc.Sequence.index>` method now
939+
The :meth:`Sequence.index() <collections.abc.MutableSequence.index>` method now
941940
accepts *start* and *stop* arguments to match the corresponding methods
942941
of :class:`tuple`, :class:`list`, etc.
943942
(Contributed by Devin Jeanpierre in :issue:`23086`.)
@@ -1045,8 +1044,8 @@ not just sequences. (Contributed by Serhiy Storchaka in :issue:`23171`.)
10451044
curses
10461045
------
10471046

1048-
The new :func:`~curses.update_lines_cols` function updates the :data:`LINES`
1049-
and :data:`COLS` module variables. This is useful for detecting
1047+
The new :func:`~curses.update_lines_cols` function updates the :data:`~curses.LINES`
1048+
and :data:`~curses.COLS` module variables. This is useful for detecting
10501049
manual screen resizing. (Contributed by Arnon Yaari in :issue:`4254`.)
10511050

10521051

@@ -1347,8 +1346,8 @@ network objects from existing addresses::
13471346

13481347
(Contributed by Peter Moody and Antoine Pitrou in :issue:`16531`.)
13491348

1350-
A new :attr:`~ipaddress.IPv4Network.reverse_pointer` attribute for the
1351-
:class:`~ipaddress.IPv4Network` and :class:`~ipaddress.IPv6Network` classes
1349+
A new :attr:`~ipaddress.IPv4Address.reverse_pointer` attribute for the
1350+
:class:`~ipaddress.IPv4Address` and :class:`~ipaddress.IPv6Address` classes
13521351
returns the name of the reverse DNS PTR record::
13531352

13541353
>>> import ipaddress
@@ -1451,7 +1450,7 @@ and :data:`~math.nan`. (Contributed by Mark Dickinson in :issue:`23185`.)
14511450
A new function :func:`~math.isclose` provides a way to test for approximate
14521451
equality. (Contributed by Chris Barker and Tal Einat in :issue:`24270`.)
14531452

1454-
A new :func:`~math.gcd` function has been added. The :func:`fractions.gcd`
1453+
A new :func:`~math.gcd` function has been added. The :func:`!fractions.gcd`
14551454
function is now deprecated. (Contributed by Mark Dickinson and Serhiy
14561455
Storchaka in :issue:`22486`.)
14571456

@@ -1602,10 +1601,10 @@ The :func:`~re.sub` and :func:`~re.subn` functions now replace unmatched
16021601
groups with empty strings instead of raising an exception.
16031602
(Contributed by Serhiy Storchaka in :issue:`1519638`.)
16041603

1605-
The :class:`re.error` exceptions have new attributes,
1606-
:attr:`~re.error.msg`, :attr:`~re.error.pattern`,
1607-
:attr:`~re.error.pos`, :attr:`~re.error.lineno`,
1608-
and :attr:`~re.error.colno`, that provide better context
1604+
The :class:`re.error <re.PatternError>` exceptions have new attributes,
1605+
:attr:`~re.PatternError.msg`, :attr:`~re.PatternError.pattern`,
1606+
:attr:`~re.PatternError.pos`, :attr:`~re.PatternError.lineno`,
1607+
and :attr:`~re.PatternError.colno`, that provide better context
16091608
information about the error::
16101609

16111610
>>> re.compile("""
@@ -1794,10 +1793,10 @@ query the actual protocol version in use.
17941793
(Contributed by Antoine Pitrou in :issue:`20421`.)
17951794

17961795
The :class:`~ssl.SSLSocket` class now implements
1797-
a :meth:`SSLSocket.sendfile() <ssl.SSLSocket.sendfile>` method.
1796+
a :meth:`!SSLSocket.sendfile` method.
17981797
(Contributed by Giampaolo Rodola' in :issue:`17552`.)
17991798

1800-
The :meth:`SSLSocket.send() <ssl.SSLSocket.send>` method now raises either
1799+
The :meth:`!SSLSocket.send` method now raises either
18011800
the :exc:`ssl.SSLWantReadError` or :exc:`ssl.SSLWantWriteError` exception on a
18021801
non-blocking socket if the operation would block. Previously, it would return
18031802
``0``. (Contributed by Nikolaus Rath in :issue:`20951`.)
@@ -1806,20 +1805,20 @@ The :func:`~ssl.cert_time_to_seconds` function now interprets the input time
18061805
as UTC and not as local time, per :rfc:`5280`. Additionally, the return
18071806
value is always an :class:`int`. (Contributed by Akira Li in :issue:`19940`.)
18081807

1809-
New :meth:`SSLObject.shared_ciphers() <ssl.SSLObject.shared_ciphers>` and
1808+
New :meth:`!SSLObject.shared_ciphers` and
18101809
:meth:`SSLSocket.shared_ciphers() <ssl.SSLSocket.shared_ciphers>` methods return
18111810
the list of ciphers sent by the client during the handshake.
18121811
(Contributed by Benjamin Peterson in :issue:`23186`.)
18131812

18141813
The :meth:`SSLSocket.do_handshake() <ssl.SSLSocket.do_handshake>`,
18151814
:meth:`SSLSocket.read() <ssl.SSLSocket.read>`,
1816-
:meth:`SSLSocket.shutdown() <ssl.SSLSocket.shutdown>`, and
1815+
:meth:`!SSLSocket.shutdown`, and
18171816
:meth:`SSLSocket.write() <ssl.SSLSocket.write>` methods of the :class:`~ssl.SSLSocket`
18181817
class no longer reset the socket timeout every time bytes are received or sent.
18191818
The socket timeout is now the maximum total duration of the method.
18201819
(Contributed by Victor Stinner in :issue:`23853`.)
18211820

1822-
The :func:`~ssl.match_hostname` function now supports matching of IP addresses.
1821+
The :func:`!match_hostname` function now supports matching of IP addresses.
18231822
(Contributed by Antoine Pitrou in :issue:`23239`.)
18241823

18251824

@@ -1863,10 +1862,10 @@ Examples::
18631862
sys
18641863
---
18651864

1866-
A new :func:`~sys.set_coroutine_wrapper` function allows setting a global
1865+
A new :func:`!set_coroutine_wrapper` function allows setting a global
18671866
hook that will be called whenever a :term:`coroutine object <coroutine>`
18681867
is created by an :keyword:`async def` function. A corresponding
1869-
:func:`~sys.get_coroutine_wrapper` can be used to obtain a currently set
1868+
:func:`!get_coroutine_wrapper` can be used to obtain a currently set
18701869
wrapper. Both functions are :term:`provisional <provisional API>`,
18711870
and are intended for debugging purposes only. (Contributed by Yury Selivanov
18721871
in :issue:`24017`.)
@@ -2014,8 +2013,9 @@ The :class:`~unittest.mock.Mock` class has the following improvements:
20142013
method to check if the mock object was called.
20152014
(Contributed by Kushal Das in :issue:`21262`.)
20162015

2017-
The :class:`~unittest.mock.MagicMock` class now supports :meth:`__truediv__`,
2018-
:meth:`__divmod__` and :meth:`__matmul__` operators.
2016+
The :class:`~unittest.mock.MagicMock` class now supports
2017+
:meth:`~object.__truediv__`, :meth:`~object.__divmod__`
2018+
and :meth:`~object.__matmul__` operators.
20192019
(Contributed by Johannes Baiter in :issue:`20968`, and Håkan Lövdahl
20202020
in :issue:`23581` and :issue:`23568`.)
20212021

@@ -2290,10 +2290,10 @@ Windows XP is no longer supported by Microsoft, thus, per :PEP:`11`, CPython
22902290
Deprecated Python modules, functions and methods
22912291
------------------------------------------------
22922292

2293-
The :mod:`formatter` module has now graduated to full deprecation and is still
2293+
The :mod:`!formatter` module has now graduated to full deprecation and is still
22942294
slated for removal in Python 3.6.
22952295

2296-
The :func:`asyncio.async` function is deprecated in favor of
2296+
The :func:`!asyncio.async` function is deprecated in favor of
22972297
:func:`~asyncio.ensure_future`.
22982298

22992299
The :mod:`!smtpd` module has in the past always decoded the DATA portion of
@@ -2314,7 +2314,7 @@ Passing a format string as keyword argument *format_string* to the
23142314
class has been deprecated.
23152315
(Contributed by Serhiy Storchaka in :issue:`23671`.)
23162316

2317-
The :func:`platform.dist` and :func:`platform.linux_distribution` functions
2317+
The :func:`!platform.dist` and :func:`!platform.linux_distribution` functions
23182318
are now deprecated. Linux distributions use too many different ways of
23192319
describing themselves, so the functionality is left to a package.
23202320
(Contributed by Vajrasky Kok and Berker Peksag in :issue:`1322`.)
@@ -2328,7 +2328,7 @@ The :func:`inspect.getargspec` function is deprecated and scheduled to be
23282328
removed in Python 3.6. (See :issue:`20438` for details.)
23292329

23302330
The :mod:`inspect` :func:`~inspect.getfullargspec`,
2331-
:func:`~inspect.getcallargs`, and :func:`~inspect.formatargspec` functions are
2331+
:func:`~inspect.getcallargs`, and :func:`!formatargspec` functions are
23322332
deprecated in favor of the :func:`inspect.signature` API. (Contributed by Yury
23332333
Selivanov in :issue:`20438`.)
23342334

@@ -2405,7 +2405,7 @@ Changes in the Python API
24052405
error-prone and has been removed in Python 3.5. See :issue:`13936` for full
24062406
details.
24072407

2408-
* The :meth:`ssl.SSLSocket.send` method now raises either
2408+
* The :meth:`!ssl.SSLSocket.send` method now raises either
24092409
:exc:`ssl.SSLWantReadError` or :exc:`ssl.SSLWantWriteError`
24102410
on a non-blocking socket if the operation would block. Previously,
24112411
it would return ``0``. (Contributed by Nikolaus Rath in :issue:`20951`.)
@@ -2440,12 +2440,12 @@ Changes in the Python API
24402440
:mod:`http.client` and :mod:`http.server` remain available for backwards
24412441
compatibility. (Contributed by Demian Brecht in :issue:`21793`.)
24422442

2443-
* When an import loader defines :meth:`importlib.machinery.Loader.exec_module`
2443+
* When an import loader defines :meth:`~importlib.abc.Loader.exec_module`
24442444
it is now expected to also define
2445-
:meth:`~importlib.machinery.Loader.create_module` (raises a
2445+
:meth:`~importlib.abc.Loader.create_module` (raises a
24462446
:exc:`DeprecationWarning` now, will be an error in Python 3.6). If the loader
24472447
inherits from :class:`importlib.abc.Loader` then there is nothing to do, else
2448-
simply define :meth:`~importlib.machinery.Loader.create_module` to return
2448+
simply define :meth:`~importlib.abc.Loader.create_module` to return
24492449
``None``. (Contributed by Brett Cannon in :issue:`23014`.)
24502450

24512451
* The :func:`re.split` function always ignored empty pattern matches, so the
@@ -2488,7 +2488,7 @@ Changes in the Python API
24882488
the POT-Creation-Date header.
24892489

24902490
* The :mod:`smtplib` module now uses :data:`sys.stderr` instead of the previous
2491-
module-level :data:`stderr` variable for debug output. If your (test)
2491+
module-level :data:`!stderr` variable for debug output. If your (test)
24922492
program depends on patching the module-level variable to capture the debug
24932493
output, you will need to update it to capture sys.stderr instead.
24942494

@@ -2514,11 +2514,11 @@ Changes in the C API
25142514
--------------------
25152515

25162516
* The undocumented :c:member:`!format` member of the
2517-
(non-public) :c:type:`PyMemoryViewObject` structure has been removed.
2517+
(non-public) :c:type:`!PyMemoryViewObject` structure has been removed.
25182518
All extensions relying on the relevant parts in ``memoryobject.h``
25192519
must be rebuilt.
25202520

2521-
* The :c:type:`PyMemAllocator` structure was renamed to
2521+
* The :c:type:`!PyMemAllocator` structure was renamed to
25222522
:c:type:`PyMemAllocatorEx` and a new ``calloc`` field was added.
25232523

25242524
* Removed non-documented macro :c:macro:`!PyObject_REPR()` which leaked references.

0 commit comments

Comments
 (0)