summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2023-07-21 11:51:00 (GMT)
committerGitHub <noreply@github.com>2023-07-21 11:51:00 (GMT)
commitffc7678f4683a63180c1321334c76e9b3e09b0a5 (patch)
treed30f26c7bf420a4c41b656b2e3e8e8c48a9242cf /Doc/whatsnew
parent84e52171b541ecc01f2d738cf82f5d4199a4bce7 (diff)
downloadcpython-ffc7678f4683a63180c1321334c76e9b3e09b0a5.zip
cpython-ffc7678f4683a63180c1321334c76e9b3e09b0a5.tar.gz
cpython-ffc7678f4683a63180c1321334c76e9b3e09b0a5.tar.bz2
[3.12] gh-106892: Use roles :data: and :const: for referencing module variables (GH-106894) (GH-106954)
(cherry picked from commit d036db728ea3d54509cbad06df74e2d9a31fbec8)
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r--Doc/whatsnew/2.5.rst8
-rw-r--r--Doc/whatsnew/3.1.rst4
-rw-r--r--Doc/whatsnew/3.11.rst2
-rw-r--r--Doc/whatsnew/3.12.rst2
-rw-r--r--Doc/whatsnew/3.2.rst32
-rw-r--r--Doc/whatsnew/3.3.rst30
-rw-r--r--Doc/whatsnew/3.4.rst14
-rw-r--r--Doc/whatsnew/3.6.rst4
-rw-r--r--Doc/whatsnew/3.8.rst2
-rw-r--r--Doc/whatsnew/3.9.rst8
10 files changed, 53 insertions, 53 deletions
diff --git a/Doc/whatsnew/2.5.rst b/Doc/whatsnew/2.5.rst
index dcfaef6..b410fe1 100644
--- a/Doc/whatsnew/2.5.rst
+++ b/Doc/whatsnew/2.5.rst
@@ -1448,10 +1448,10 @@ complete list of changes, or look through the SVN logs for all the details.
return times that are precise to fractions of a second; not all systems support
such precision.)
- Constants named :attr:`os.SEEK_SET`, :attr:`os.SEEK_CUR`, and
- :attr:`os.SEEK_END` have been added; these are the parameters to the
+ Constants named :const:`os.SEEK_SET`, :const:`os.SEEK_CUR`, and
+ :const:`os.SEEK_END` have been added; these are the parameters to the
:func:`os.lseek` function. Two new constants for locking are
- :attr:`os.O_SHLOCK` and :attr:`os.O_EXLOCK`.
+ :const:`os.O_SHLOCK` and :const:`os.O_EXLOCK`.
Two new functions, :func:`wait3` and :func:`wait4`, were added. They're similar
the :func:`waitpid` function which waits for a child process to exit and returns
@@ -1602,7 +1602,7 @@ complete list of changes, or look through the SVN logs for all the details.
* The :mod:`unicodedata` module has been updated to use version 4.1.0 of the
Unicode character database. Version 3.2.0 is required by some specifications,
- so it's still available as :attr:`unicodedata.ucd_3_2_0`.
+ so it's still available as :data:`unicodedata.ucd_3_2_0`.
* New module: the :mod:`uuid` module generates universally unique identifiers
(UUIDs) according to :rfc:`4122`. The RFC defines several different UUID
diff --git a/Doc/whatsnew/3.1.rst b/Doc/whatsnew/3.1.rst
index fba8816..e4365d4 100644
--- a/Doc/whatsnew/3.1.rst
+++ b/Doc/whatsnew/3.1.rst
@@ -370,7 +370,7 @@ New, Improved, and Deprecated Modules
* The :mod:`io` module has three new constants for the :meth:`seek`
method :data:`SEEK_SET`, :data:`SEEK_CUR`, and :data:`SEEK_END`.
-* The :attr:`sys.version_info` tuple is now a named tuple::
+* The :data:`sys.version_info` tuple is now a named tuple::
>>> sys.version_info
sys.version_info(major=3, minor=1, micro=0, releaselevel='alpha', serial=2)
@@ -486,7 +486,7 @@ Changes to Python's build process and to the C API include:
Apart from the performance improvements this change should be invisible to
end users, with one exception: for testing and debugging purposes there's a
- new :attr:`sys.int_info` that provides information about the
+ new :data:`sys.int_info` that provides information about the
internal format, giving the number of bits per digit and the size in bytes
of the C type used to store each digit::
diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst
index 0585ecc..4d9aed0 100644
--- a/Doc/whatsnew/3.11.rst
+++ b/Doc/whatsnew/3.11.rst
@@ -640,7 +640,7 @@ dataclasses
datetime
--------
-* Add :attr:`datetime.UTC`, a convenience alias for
+* Add :const:`datetime.UTC`, a convenience alias for
:attr:`datetime.timezone.utc`. (Contributed by Kabir Kwatra in :gh:`91973`.)
* :meth:`datetime.date.fromisoformat`, :meth:`datetime.time.fromisoformat` and
diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst
index b4a3fd5..9d05352 100644
--- a/Doc/whatsnew/3.12.rst
+++ b/Doc/whatsnew/3.12.rst
@@ -1042,7 +1042,7 @@ Deprecated
datetimes in UTC: respectively, call
:meth:`~datetime.datetime.now` and
:meth:`~datetime.datetime.fromtimestamp` with the *tz* parameter set to
- :attr:`datetime.UTC`.
+ :const:`datetime.UTC`.
(Contributed by Paul Ganssle in :gh:`103857`.)
Pending Removal in Python 3.13
diff --git a/Doc/whatsnew/3.2.rst b/Doc/whatsnew/3.2.rst
index 504bbf6..a427758 100644
--- a/Doc/whatsnew/3.2.rst
+++ b/Doc/whatsnew/3.2.rst
@@ -424,7 +424,7 @@ protocols, the users must to be able access the environment using native strings
even though the underlying platform may have a different convention. To bridge
this gap, the :mod:`wsgiref` module has a new function,
:func:`wsgiref.handlers.read_environ` for transcoding CGI variables from
-:attr:`os.environ` into native strings and returning a new dictionary.
+:data:`os.environ` into native strings and returning a new dictionary.
.. seealso::
@@ -485,7 +485,7 @@ Some smaller changes made to the core Python language are:
* The interpreter can now be started with a quiet option, ``-q``, to prevent
the copyright and version information from being displayed in the interactive
- mode. The option can be introspected using the :attr:`sys.flags` attribute:
+ mode. The option can be introspected using the :data:`sys.flags` attribute:
.. code-block:: shell-session
@@ -568,7 +568,7 @@ Some smaller changes made to the core Python language are:
* The internal :c:type:`structsequence` tool now creates subclasses of tuple.
This means that C structures like those returned by :func:`os.stat`,
- :func:`time.gmtime`, and :attr:`sys.version_info` now work like a
+ :func:`time.gmtime`, and :data:`sys.version_info` now work like a
:term:`named tuple` and now work with functions and methods that
expect a tuple as an argument. This is a big step forward in making the C
structures as flexible as their pure Python counterparts:
@@ -598,7 +598,7 @@ Some smaller changes made to the core Python language are:
module, or on the command line.
A :exc:`ResourceWarning` is issued at interpreter shutdown if the
- :data:`gc.garbage` list isn't empty, and if :attr:`gc.DEBUG_UNCOLLECTABLE` is
+ :data:`gc.garbage` list isn't empty, and if :const:`gc.DEBUG_UNCOLLECTABLE` is
set, all uncollectable objects are printed. This is meant to make the
programmer aware that their code contains object finalization issues.
@@ -623,7 +623,7 @@ Some smaller changes made to the core Python language are:
:class:`collections.Sequence` :term:`abstract base class`. As a result, the
language will have a more uniform API. In addition, :class:`range` objects
now support slicing and negative indices, even with values larger than
- :attr:`sys.maxsize`. This makes *range* more interoperable with lists::
+ :data:`sys.maxsize`. This makes *range* more interoperable with lists::
>>> range(0, 100, 2).count(10)
1
@@ -1007,13 +1007,13 @@ datetime and time
after 1900. The new supported year range is from 1000 to 9999 inclusive.
* Whenever a two-digit year is used in a time tuple, the interpretation has been
- governed by :attr:`time.accept2dyear`. The default is ``True`` which means that
+ governed by :data:`time.accept2dyear`. The default is ``True`` which means that
for a two-digit year, the century is guessed according to the POSIX rules
governing the ``%y`` strptime format.
Starting with Py3.2, use of the century guessing heuristic will emit a
:exc:`DeprecationWarning`. Instead, it is recommended that
- :attr:`time.accept2dyear` be set to ``False`` so that large date ranges
+ :data:`time.accept2dyear` be set to ``False`` so that large date ranges
can be used without guesswork::
>>> import time, warnings
@@ -1031,7 +1031,7 @@ datetime and time
'Fri Jan 1 12:34:56 11'
Several functions now have significantly expanded date ranges. When
- :attr:`time.accept2dyear` is false, the :func:`time.asctime` function will
+ :data:`time.accept2dyear` is false, the :func:`time.asctime` function will
accept any year that fits in a C int, while the :func:`time.mktime` and
:func:`time.strftime` functions will accept the full range supported by the
corresponding operating system functions.
@@ -1194,11 +1194,11 @@ can be set to "$" for the shell-style formatting provided by
If no configuration is set-up before a logging event occurs, there is now a
default configuration using a :class:`~logging.StreamHandler` directed to
-:attr:`sys.stderr` for events of ``WARNING`` level or higher. Formerly, an
+:data:`sys.stderr` for events of ``WARNING`` level or higher. Formerly, an
event occurring before a configuration was set-up would either raise an
exception or silently drop the event depending on the value of
-:attr:`logging.raiseExceptions`. The new default handler is stored in
-:attr:`logging.lastResort`.
+:data:`logging.raiseExceptions`. The new default handler is stored in
+:data:`logging.lastResort`.
The use of filters has been simplified. Instead of creating a
:class:`~logging.Filter` object, the predicate can be any Python callable that
@@ -1300,7 +1300,7 @@ values are equal (:issue:`8188`)::
hash(Decimal("1.5")) == hash(complex(1.5, 0))
Some of the hashing details are exposed through a new attribute,
-:attr:`sys.hash_info`, which describes the bit width of the hash value, the
+:data:`sys.hash_info`, which describes the bit width of the hash value, the
prime modulus, the hash values for *infinity* and *nan*, and the multiplier
used for the imaginary part of a number:
@@ -1388,7 +1388,7 @@ select
------
The :mod:`select` module now exposes a new, constant attribute,
-:attr:`~select.PIPE_BUF`, which gives the minimum number of bytes which are
+:const:`~select.PIPE_BUF`, which gives the minimum number of bytes which are
guaranteed not to block when :func:`select.select` says a pipe is ready
for writing.
@@ -1529,7 +1529,7 @@ filenames:
b'Sehensw\xc3\xbcrdigkeiten'
Some operating systems allow direct access to encoded bytes in the
-environment. If so, the :attr:`os.supports_bytes_environ` constant will be
+environment. If so, the :const:`os.supports_bytes_environ` constant will be
true.
For direct access to encoded environment variables (if available),
@@ -2302,7 +2302,7 @@ turtledemo
The demonstration code for the :mod:`turtle` module was moved from the *Demo*
directory to main library. It includes over a dozen sample scripts with
-lively displays. Being on :attr:`sys.path`, it can now be run directly
+lively displays. Being on :data:`sys.path`, it can now be run directly
from the command-line:
.. code-block:: shell-session
@@ -2566,7 +2566,7 @@ Changes to Python's build process and to the C API include:
(:issue:`2443`).
* A new C API function :c:func:`PySys_SetArgvEx` allows an embedded interpreter
- to set :attr:`sys.argv` without also modifying :attr:`sys.path`
+ to set :data:`sys.argv` without also modifying :data:`sys.path`
(:issue:`5753`).
* :c:macro:`PyEval_CallObject` is now only available in macro form. The
diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst
index b3f4e9a..765ba60 100644
--- a/Doc/whatsnew/3.3.rst
+++ b/Doc/whatsnew/3.3.rst
@@ -648,7 +648,7 @@ PEP 421: Adding sys.implementation
A new attribute on the :mod:`sys` module exposes details specific to the
implementation of the currently running interpreter. The initial set of
-attributes on :attr:`sys.implementation` are ``name``, ``version``,
+attributes on :data:`sys.implementation` are ``name``, ``version``,
``hexversion``, and ``cache_tag``.
The intention of ``sys.implementation`` is to consolidate into one namespace
@@ -719,7 +719,7 @@ and does not enforce any method requirements.
In terms of finders, :class:`importlib.machinery.FileFinder` exposes the
mechanism used to search for source and bytecode files of a module. Previously
-this class was an implicit member of :attr:`sys.path_hooks`.
+this class was an implicit member of :data:`sys.path_hooks`.
For loaders, the new abstract base class :class:`importlib.abc.FileLoader` helps
write a loader that uses the file system as the storage mechanism for a module's
@@ -735,7 +735,7 @@ provide the full name of the module now instead of just the tail end of the
module's name.
The :func:`importlib.invalidate_caches` function will now call the method with
-the same name on all finders cached in :attr:`sys.path_importer_cache` to help
+the same name on all finders cached in :data:`sys.path_importer_cache` to help
clean up any stored state as necessary.
Visible Changes
@@ -745,8 +745,8 @@ For potential required changes to code, see the `Porting Python code`_
section.
Beyond the expanse of what :mod:`importlib` now exposes, there are other
-visible changes to import. The biggest is that :attr:`sys.meta_path` and
-:attr:`sys.path_hooks` now store all of the meta path finders and path entry
+visible changes to import. The biggest is that :data:`sys.meta_path` and
+:data:`sys.path_hooks` now store all of the meta path finders and path entry
hooks used by import. Previously the finders were implicit and hidden within
the C code of import instead of being directly exposed. This means that one can
now easily remove or change the order of the various finders to fit one's needs.
@@ -761,9 +761,9 @@ Loaders are also now expected to set the ``__package__`` attribute from
:pep:`366`. Once again, import itself is already setting this on all loaders
from :mod:`importlib` and import itself is setting the attribute post-load.
-``None`` is now inserted into :attr:`sys.path_importer_cache` when no finder
-can be found on :attr:`sys.path_hooks`. Since :class:`!imp.NullImporter` is not
-directly exposed on :attr:`sys.path_hooks` it could no longer be relied upon to
+``None`` is now inserted into :data:`sys.path_importer_cache` when no finder
+can be found on :data:`sys.path_hooks`. Since :class:`!imp.NullImporter` is not
+directly exposed on :data:`sys.path_hooks` it could no longer be relied upon to
always be available to use as a value representing no finder found.
All other changes relate to semantic changes which should be taken into
@@ -1952,7 +1952,7 @@ ssl
* You can query the SSL compression algorithm used by an SSL socket, thanks
to its new :meth:`~ssl.SSLSocket.compression` method. The new attribute
- :attr:`~ssl.OP_NO_COMPRESSION` can be used to disable compression.
+ :const:`~ssl.OP_NO_COMPRESSION` can be used to disable compression.
(Contributed by Antoine Pitrou in :issue:`13634`.)
* Support has been added for the Next Protocol Negotiation extension using
@@ -1966,7 +1966,7 @@ ssl
* The :func:`~ssl.get_server_certificate` function now supports IPv6.
(Contributed by Charles-François Natali in :issue:`11811`.)
-* New attribute :attr:`~ssl.OP_CIPHER_SERVER_PREFERENCE` allows setting
+* New attribute :const:`~ssl.OP_CIPHER_SERVER_PREFERENCE` allows setting
SSLv3 server sockets to use the server's cipher ordering preference rather
than the client's (:issue:`13635`).
@@ -2141,7 +2141,7 @@ New attribute :attr:`zlib.Decompress.eof` makes it possible to distinguish
between a properly formed compressed stream and an incomplete or truncated one.
(Contributed by Nadeem Vawda in :issue:`12646`.)
-New attribute :attr:`zlib.ZLIB_RUNTIME_VERSION` reports the version string of
+New attribute :const:`zlib.ZLIB_RUNTIME_VERSION` reports the version string of
the underlying ``zlib`` library that is loaded at runtime. (Contributed by
Torsten Landschoff in :issue:`12306`.)
@@ -2378,16 +2378,16 @@ Porting Python code
* :func:`__import__` no longer allows one to use an index value other than 0
for top-level modules. E.g. ``__import__('sys', level=1)`` is now an error.
-* Because :attr:`sys.meta_path` and :attr:`sys.path_hooks` now have finders on
+* Because :data:`sys.meta_path` and :data:`sys.path_hooks` now have finders on
them by default, you will most likely want to use :meth:`list.insert` instead
of :meth:`list.append` to add to those lists.
-* Because ``None`` is now inserted into :attr:`sys.path_importer_cache`, if you
+* Because ``None`` is now inserted into :data:`sys.path_importer_cache`, if you
are clearing out entries in the dictionary of paths that do not have a
finder, you will need to remove keys paired with values of ``None`` **and**
:class:`!imp.NullImporter` to be backwards-compatible. This will lead to extra
overhead on older versions of Python that re-insert ``None`` into
- :attr:`sys.path_importer_cache` where it represents the use of implicit
+ :data:`sys.path_importer_cache` where it represents the use of implicit
finders, but semantically it should not change anything.
* :class:`!importlib.abc.Finder` no longer specifies a ``find_module()`` abstract
@@ -2445,7 +2445,7 @@ Porting Python code
error instead of sleeping forever. It has always raised an error on posix.
* The ``ast.__version__`` constant has been removed. If you need to
- make decisions affected by the AST version, use :attr:`sys.version_info`
+ make decisions affected by the AST version, use :data:`sys.version_info`
to make the decision.
* Code that used to work around the fact that the :mod:`threading` module used
diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst
index d72163b..acb6621 100644
--- a/Doc/whatsnew/3.4.rst
+++ b/Doc/whatsnew/3.4.rst
@@ -1323,14 +1323,14 @@ ability to query or set the resource limits for processes other than the one
making the call. (Contributed by Christian Heimes in :issue:`16595`.)
On Linux kernel version 2.6.36 or later, there are also some new
-Linux specific constants: :attr:`~resource.RLIMIT_MSGQUEUE`,
-:attr:`~resource.RLIMIT_NICE`, :attr:`~resource.RLIMIT_RTPRIO`,
-:attr:`~resource.RLIMIT_RTTIME`, and :attr:`~resource.RLIMIT_SIGPENDING`.
+Linux specific constants: :const:`~resource.RLIMIT_MSGQUEUE`,
+:const:`~resource.RLIMIT_NICE`, :const:`~resource.RLIMIT_RTPRIO`,
+:const:`~resource.RLIMIT_RTTIME`, and :const:`~resource.RLIMIT_SIGPENDING`.
(Contributed by Christian Heimes in :issue:`19324`.)
On FreeBSD version 9 and later, there some new FreeBSD specific constants:
-:attr:`~resource.RLIMIT_SBSIZE`, :attr:`~resource.RLIMIT_SWAP`, and
-:attr:`~resource.RLIMIT_NPTS`. (Contributed by Claudiu Popa in
+:const:`~resource.RLIMIT_SBSIZE`, :const:`~resource.RLIMIT_SWAP`, and
+:const:`~resource.RLIMIT_NPTS`. (Contributed by Claudiu Popa in
:issue:`19343`.)
@@ -1500,7 +1500,7 @@ implementation is required as most of the values aren't standardized and
are platform-dependent. (Contributed by Christian Heimes in :issue:`11016`.)
The module supports new :mod:`~stat.ST_MODE` flags, :mod:`~stat.S_IFDOOR`,
-:attr:`~stat.S_IFPORT`, and :attr:`~stat.S_IFWHT`. (Contributed by
+:const:`~stat.S_IFPORT`, and :const:`~stat.S_IFWHT`. (Contributed by
Christian Hiemes in :issue:`11016`.)
@@ -1849,7 +1849,7 @@ Python's default implementation to a SipHash implementation on platforms that
have a 64 bit data type. Any performance differences in comparison with the
older FNV algorithm are trivial.
-The PEP adds additional fields to the :attr:`sys.hash_info` named tuple to
+The PEP adds additional fields to the :data:`sys.hash_info` named tuple to
describe the hash algorithm in use by the currently executing binary. Otherwise,
the PEP does not alter any existing CPython APIs.
diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst
index 84b0438..1093d24 100644
--- a/Doc/whatsnew/3.6.rst
+++ b/Doc/whatsnew/3.6.rst
@@ -1388,7 +1388,7 @@ are treated as punctuation.
site
----
-When specifying paths to add to :attr:`sys.path` in a ``.pth`` file,
+When specifying paths to add to :data:`sys.path` in a ``.pth`` file,
you may now specify file paths on top of directories (e.g. zip files).
(Contributed by Wolfgang Langner in :issue:`26587`).
@@ -2010,7 +2010,7 @@ been deprecated in previous versions of Python in favour of
:meth:`importlib.abc.Loader.exec_module`.
The :class:`importlib.machinery.WindowsRegistryFinder` class is now
-deprecated. As of 3.6.0, it is still added to :attr:`sys.meta_path` by
+deprecated. As of 3.6.0, it is still added to :data:`sys.meta_path` by
default (on Windows), but this may change in future releases.
os
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst
index ba3d8611..5df2cef 100644
--- a/Doc/whatsnew/3.8.rst
+++ b/Doc/whatsnew/3.8.rst
@@ -1839,7 +1839,7 @@ Changes in Python behavior
classes will affect their string representation.
(Contributed by Serhiy Storchaka in :issue:`36793`.)
-* On AIX, :attr:`sys.platform` doesn't contain the major version anymore.
+* On AIX, :data:`sys.platform` doesn't contain the major version anymore.
It is always ``'aix'``, instead of ``'aix3'`` .. ``'aix7'``. Since
older Python versions include the version number, so it is recommended to
always use ``sys.platform.startswith('aix')``.
diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst
index 36d942e..1f0fbbc 100644
--- a/Doc/whatsnew/3.9.rst
+++ b/Doc/whatsnew/3.9.rst
@@ -692,13 +692,13 @@ which has nanosecond resolution, rather than
sys
---
-Added a new :attr:`sys.platlibdir` attribute: name of the platform-specific
+Added a new :data:`sys.platlibdir` attribute: name of the platform-specific
library directory. It is used to build the path of standard library and the
paths of installed extension modules. It is equal to ``"lib"`` on most
platforms. On Fedora and SuSE, it is equal to ``"lib64"`` on 64-bit platforms.
(Contributed by Jan Matějek, Matěj Cepl, Charalampos Stratakis and Victor Stinner in :issue:`1294959`.)
-Previously, :attr:`sys.stderr` was block-buffered when non-interactive. Now
+Previously, :data:`sys.stderr` was block-buffered when non-interactive. Now
``stderr`` defaults to always being line-buffered.
(Contributed by Jendrik Seipp in :issue:`13601`.)
@@ -1226,8 +1226,8 @@ Build Changes
=============
* Added ``--with-platlibdir`` option to the ``configure`` script: name of the
- platform-specific library directory, stored in the new :attr:`sys.platlibdir`
- attribute. See :attr:`sys.platlibdir` attribute for more information.
+ platform-specific library directory, stored in the new :data:`sys.platlibdir`
+ attribute. See :data:`sys.platlibdir` attribute for more information.
(Contributed by Jan Matějek, Matěj Cepl, Charalampos Stratakis
and Victor Stinner in :issue:`1294959`.)