@@ -352,7 +352,7 @@ was expecting an indentation, including the location of the statement:
352
352
AttributeErrors
353
353
~~~~~~~~~~~~~~~
354
354
355
- When printing :exc:`AttributeError ` , :c:func:`PyErr_Display` will offer
355
+ When printing :exc:`AttributeError ` , :c:func:`! PyErr_Display` will offer
356
356
suggestions of similar attribute names in the object that the exception was
357
357
raised from :
358
358
@@ -366,14 +366,14 @@ raised from:
366
366
(Contributed by Pablo Galindo in :issue:`38530 ` .)
367
367
368
368
.. warning::
369
- Notice this won' t work if :c:func:`PyErr_Display` is not called to display the error
369
+ Notice this won' t work if :c:func:`! PyErr_Display` is not called to display the error
370
370
which can happen if some other custom error display function is used. This is a common
371
371
scenario in some REPLs like IPython.
372
372
373
373
NameErrors
374
374
~~~~~~~~~~
375
375
376
- When printing :exc:`NameError ` raised by the interpreter, :c:func:`PyErr_Display`
376
+ When printing :exc:`NameError ` raised by the interpreter, :c:func:`! PyErr_Display`
377
377
will offer suggestions of similar variable names in the function that the exception
378
378
was raised from :
379
379
@@ -388,7 +388,7 @@ was raised from:
388
388
(Contributed by Pablo Galindo in :issue:`38530 ` .)
389
389
390
390
.. warning::
391
- Notice this won' t work if :c:func:`PyErr_Display` is not called to display the error,
391
+ Notice this won' t work if :c:func:`! PyErr_Display` is not called to display the error,
392
392
which can happen if some other custom error display function is used. This is a common
393
393
scenario in some REPLs like IPython.
394
394
@@ -690,7 +690,7 @@ are in :pep:`635`, and a longer tutorial is in :pep:`636`.
690
690
Optional `` EncodingWarning`` and `` encoding=" locale" `` option
691
691
------------------------------------------------------------ -
692
692
693
- The default encoding of :class :`TextIOWrapper` and :func:`open ` is
693
+ The default encoding of :class :`~ io. TextIOWrapper` and :func:`open ` is
694
694
platform and locale dependent. Since UTF - 8 is used on most Unix
695
695
platforms, omitting `` encoding`` option when opening UTF - 8 files
696
696
(e.g. JSON , YAML , TOML , Markdown) is a very common bug. For example::
@@ -785,7 +785,7 @@ especially when forward references or invalid types were involved. Compare::
785
785
StrCache = ' Cache[str]' # a type alias
786
786
LOG_PREFIX = ' LOG[DEBUG]' # a module constant
787
787
788
- Now the :mod:`typing` module has a special value :data:`TypeAlias`
788
+ Now the :mod:`typing` module has a special value :data:`~ typing. TypeAlias`
789
789
which lets you declare type aliases more explicitly::
790
790
791
791
StrCache: TypeAlias = ' Cache[str]' # a type alias
@@ -798,10 +798,10 @@ See :pep:`613` for more details.
798
798
PEP 647 : User- Defined Type Guards
799
799
-------------------------------- -
800
800
801
- :data:`TypeGuard` has been added to the :mod:`typing` module to annotate
801
+ :data:`~ typing. TypeGuard` has been added to the :mod:`typing` module to annotate
802
802
type guard functions and improve information provided to static type checkers
803
- during type narrowing. For more information, please see :data: `TypeGuard` \ 's
804
- documentation, and :pep:`647 ` .
803
+ during type narrowing. For more information, please see
804
+ :data: ` ~ typing.TypeGuard` \ 's documentation, and :pep:`647`.
805
805
806
806
(Contributed by Ken Jin and Guido van Rossum in :issue:`43766 ` .
807
807
PEP written by Eric Traut.)
@@ -972,8 +972,8 @@ and objects representing asynchronously released resources.
972
972
Add asynchronous context manager support to :func:`contextlib.nullcontext` .
973
973
(Contributed by Tom Gringauz in :issue:`41543 ` .)
974
974
975
- Add :class :`AsyncContextDecorator` , for supporting usage of async context managers
976
- as decorators.
975
+ Add :class :`~ contextlib. AsyncContextDecorator` , for supporting usage of async
976
+ context managers as decorators.
977
977
978
978
curses
979
979
------
@@ -1089,8 +1089,8 @@ encodings
1089
1089
enum
1090
1090
----
1091
1091
1092
- :class :`Enum` :func:`__repr__ ` now returns `` enum_name.member_name`` and
1093
- :func:`__str__ ` now returns `` member_name`` . Stdlib enums available as
1092
+ :class :`~ enum. Enum` :func:`~ object . __repr__ ` now returns `` enum_name.member_name`` and
1093
+ :func:`~ object . __str__ ` now returns `` member_name`` . Stdlib enums available as
1094
1094
module constants have a :func:`repr ` of `` module_name.member_name`` .
1095
1095
(Contributed by Ethan Furman in :issue:`40066 ` .)
1096
1096
@@ -1104,7 +1104,7 @@ Add *encoding* and *errors* parameters in :func:`fileinput.input` and
1104
1104
:class :`fileinput.FileInput` .
1105
1105
(Contributed by Inada Naoki in :issue:`43712 ` .)
1106
1106
1107
- :func:`fileinput.hook_compressed` now returns :class :`TextIOWrapper` object
1107
+ :func:`fileinput.hook_compressed` now returns :class :`~ io. TextIOWrapper` object
1108
1108
when * mode* is " r" and file is compressed, like uncompressed files.
1109
1109
(Contributed by Inada Naoki in :issue:`5758 ` .)
1110
1110
@@ -1202,12 +1202,12 @@ Feature parity with ``importlib_metadata`` 4.6
1202
1202
:ref:`importlib.metadata entry points < entry- points> `
1203
1203
now provide a nicer experience
1204
1204
for selecting entry points by group and name through a new
1205
- :class :`importlib.metadata.EntryPoints` class . See the Compatibility
1205
+ :ref :`importlib.metadata.EntryPoints < entry - points > ` class . See the Compatibility
1206
1206
Note in the docs for more info on the deprecation and usage.
1207
1207
1208
- Added :func :`importlib.metadata.packages_distributions` for resolving
1209
- top- level Python modules and packages to their
1210
- :class :`importlib.metadata.Distribution` .
1208
+ Added :ref :`importlib.metadata.packages_distributions() < package - distributions > `
1209
+ for resolving top- level Python modules and packages to their
1210
+ :ref :`importlib.metadata.Distribution < distributions > ` .
1211
1211
1212
1212
inspect
1213
1213
------ -
@@ -1224,7 +1224,7 @@ best practice for accessing the annotations dict defined on any Python object;
1224
1224
for more information on best practices for working with annotations, please see
1225
1225
:ref:`annotations- howto` .
1226
1226
Relatedly, :func:`inspect.signature` ,
1227
- :func:`inspect.Signature.from_callable` , and :func:`inspect.Signature.from_function`
1227
+ :func:`inspect.Signature.from_callable` , and :func:`! inspect.Signature.from_function`
1228
1228
now call :func:`inspect.get_annotations` to retrieve annotations. This means
1229
1229
:func:`inspect.signature` and :func:`inspect.Signature.from_callable` can
1230
1230
also now un- stringize stringized annotations.
@@ -1484,9 +1484,9 @@ is a :class:`typing.TypedDict`.
1484
1484
1485
1485
Subclasses of `` typing.Protocol`` which only have data variables declared
1486
1486
will now raise a `` TypeError `` when checked with `` isinstance `` unless they
1487
- are decorated with :func:`runtime_checkable` . Previously, these checks
1487
+ are decorated with :func:`~ typing. runtime_checkable` . Previously, these checks
1488
1488
passed silently. Users should decorate their
1489
- subclasses with the :func:`runtime_checkable` decorator
1489
+ subclasses with the :func:`! runtime_checkable` decorator
1490
1490
if they want runtime protocols.
1491
1491
(Contributed by Yurii Karabas in :issue:`38908 ` .)
1492
1492
@@ -1595,8 +1595,8 @@ Optimizations
1595
1595
:func:`map ` , :func:`filter ` , :func:`reversed ` , :func:`bool ` and :func:`float ` .
1596
1596
(Contributed by Donghee Na and Jeroen Demeyer in :issue:`43575 ` , :issue:`43287 ` , :issue:`41922 ` , :issue:`41873 ` and :issue:`41870 ` .)
1597
1597
1598
- * :class :`BZ2File` performance is improved by removing internal `` RLock`` .
1599
- This makes :class :`BZ2File` thread unsafe in the face of multiple simultaneous
1598
+ * :class :`~ bz2. BZ2File` performance is improved by removing internal `` RLock`` .
1599
+ This makes :class :`! BZ2File` thread unsafe in the face of multiple simultaneous
1600
1600
readers or writers, just like its equivalent classes in :mod:`gzip` and
1601
1601
:mod:`lzma` have always been. (Contributed by Inada Naoki in :issue:`43785 ` .)
1602
1602
@@ -1620,7 +1620,7 @@ Deprecated
1620
1620
cleaning up old import semantics that were kept for Python 2.7
1621
1621
compatibility. Specifically,
1622
1622
:meth:`! find_loader` / :meth:`! find_module`
1623
- (superseded by :meth:`~ importlib.abc.Finder .find_spec` ),
1623
+ (superseded by :meth:`~ importlib.abc.MetaPathFinder .find_spec` ),
1624
1624
:meth:`~ importlib.abc.Loader.load_module`
1625
1625
(superseded by :meth:`~ importlib.abc.Loader.exec_module` ),
1626
1626
:meth:`! module_repr` (which the import system
@@ -1647,7 +1647,7 @@ Deprecated
1647
1647
:meth:`~ importlib.abc.Loader.exec_module` instead.
1648
1648
(Contributed by Brett Cannon in :issue:`26131 ` .)
1649
1649
1650
- * :meth:`zimport.zipimporter.load_module` has been deprecated in
1650
+ * :meth:`! zimport.zipimporter.load_module` has been deprecated in
1651
1651
preference for :meth:`~ zipimport.zipimporter.exec_module` .
1652
1652
(Contributed by Brett Cannon in :issue:`26131 ` .)
1653
1653
@@ -1759,23 +1759,23 @@ Deprecated
1759
1759
* The following :mod:`ssl` features have been deprecated since Python 3.6 ,
1760
1760
Python 3.7 , or OpenSSL 1.1 .0 and will be removed in 3.11 :
1761
1761
1762
- * :data:`~ ssl. OP_NO_SSLv2 ` , :data:`~ ssl. OP_NO_SSLv3 ` , :data:`~ ssl. OP_NO_TLSv1 ` ,
1763
- :data:`~ ssl. OP_NO_TLSv1_1 ` , :data:`~ ssl. OP_NO_TLSv1_2 ` , and
1764
- :data:`~ ssl. OP_NO_TLSv1_3 ` are replaced by
1765
- :attr:`sslSSLContext .minimum_version` and
1766
- :attr:`sslSSLContext .maximum_version` .
1762
+ * :data:`! OP_NO_SSLv2 ` , :data:`! OP_NO_SSLv3 ` , :data:`! OP_NO_TLSv1 ` ,
1763
+ :data:`! OP_NO_TLSv1_1 ` , :data:`! OP_NO_TLSv1_2 ` , and
1764
+ :data:`! OP_NO_TLSv1_3 ` are replaced by
1765
+ :attr:`~ ssl.SSLContext .minimum_version` and
1766
+ :attr:`~ ssl.SSLContext .maximum_version` .
1767
1767
1768
- * :data:`~ ssl. PROTOCOL_SSLv2 ` , :data:`~ ssl. PROTOCOL_SSLv3 ` ,
1769
- :data:`~ ssl. PROTOCOL_SSLv23 ` , :data:`~ ssl. PROTOCOL_TLSv1 ` ,
1770
- :data:`~ ssl. PROTOCOL_TLSv1_1 ` , :data:`~ ssl. PROTOCOL_TLSv1_2 ` , and
1771
- :const:`~ ssl. PROTOCOL_TLS ` are deprecated in favor of
1768
+ * :data:`! PROTOCOL_SSLv2 ` , :data:`! PROTOCOL_SSLv3 ` ,
1769
+ :data:`! PROTOCOL_SSLv23 ` , :data:`! PROTOCOL_TLSv1 ` ,
1770
+ :data:`! PROTOCOL_TLSv1_1 ` , :data:`! PROTOCOL_TLSv1_2 ` , and
1771
+ :const:`! PROTOCOL_TLS ` are deprecated in favor of
1772
1772
:const:`~ ssl.PROTOCOL_TLS_CLIENT ` and :const:`~ ssl.PROTOCOL_TLS_SERVER `
1773
1773
1774
- * :func:`~ ssl. wrap_socket` is replaced by :meth:`ssl.SSLContext.wrap_socket`
1774
+ * :func:`! wrap_socket` is replaced by :meth:`ssl.SSLContext.wrap_socket`
1775
1775
1776
- * :func:`~ ssl. match_hostname`
1776
+ * :func:`! match_hostname`
1777
1777
1778
- * :func:`~ ssl. RAND_pseudo_bytes ` , :func:`~ ssl. RAND_egd `
1778
+ * :func:`! RAND_pseudo_bytes ` , :func:`! RAND_egd `
1779
1779
1780
1780
* NPN features like :meth:`ssl.SSLSocket.selected_npn_protocol` and
1781
1781
:meth:`ssl.SSLContext.set_npn_protocols` are replaced by ALPN .
0 commit comments