summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2024-05-08 19:55:13 (GMT)
committerGitHub <noreply@github.com>2024-05-08 19:55:13 (GMT)
commit530c3bb271d85e7700f627c5d64089d270286dfa (patch)
tree23c5200c130874f8d0e6c786f4fce6b303039909 /Misc
parentb83b3cb9daf19560a171867b42d412a72b2bc4f5 (diff)
downloadcpython-530c3bb271d85e7700f627c5d64089d270286dfa.zip
cpython-530c3bb271d85e7700f627c5d64089d270286dfa.tar.gz
cpython-530c3bb271d85e7700f627c5d64089d270286dfa.tar.bz2
[3.12] Format None, True, False and NotImplemented as literals (GH-118758) (GH-118794)
(cherry picked from commit 05c2fe1acda9ea5a57061642c36e8b73bb4fbba4)
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/3.11.0a1.rst4
-rw-r--r--Misc/NEWS.d/3.11.0a2.rst4
-rw-r--r--Misc/NEWS.d/3.11.0b1.rst9
-rw-r--r--Misc/NEWS.d/3.12.0a1.rst10
-rw-r--r--Misc/NEWS.d/3.12.0a3.rst2
-rw-r--r--Misc/NEWS.d/3.12.0a4.rst4
-rw-r--r--Misc/NEWS.d/3.12.0b1.rst2
7 files changed, 18 insertions, 17 deletions
diff --git a/Misc/NEWS.d/3.11.0a1.rst b/Misc/NEWS.d/3.11.0a1.rst
index 4d424cf..460f437 100644
--- a/Misc/NEWS.d/3.11.0a1.rst
+++ b/Misc/NEWS.d/3.11.0a1.rst
@@ -2722,7 +2722,7 @@ Importing typing.io or typing.re now prints a ``DeprecationWarning``.
.. section: Library
argparse actions store_const and append_const each receive a default value
-of None when the ``const`` kwarg is not provided. Previously, this raised a
+of ``None`` when the ``const`` kwarg is not provided. Previously, this raised a
:exc:`TypeError`.
..
@@ -3995,7 +3995,7 @@ operator expressions.
.. section: Documentation
Document that :class:`collections.defaultdict` parameter ``default_factory``
-defaults to None and is positional-only.
+defaults to ``None`` and is positional-only.
..
diff --git a/Misc/NEWS.d/3.11.0a2.rst b/Misc/NEWS.d/3.11.0a2.rst
index a6b5fe5..f3fc62e 100644
--- a/Misc/NEWS.d/3.11.0a2.rst
+++ b/Misc/NEWS.d/3.11.0a2.rst
@@ -331,8 +331,8 @@ underlying SQLite API signals memory error. Patch by Erlend E. Aasland.
.. nonce: 4MQt4r
.. section: Library
-pprint.pprint() now handles underscore_numbers correctly. Previously it was
-always setting it to False.
+:func:`pprint.pprint` now handles *underscore_numbers* correctly.
+Previously it was always setting it to ``False``.
..
diff --git a/Misc/NEWS.d/3.11.0b1.rst b/Misc/NEWS.d/3.11.0b1.rst
index 21c7df8..d3e90f6 100644
--- a/Misc/NEWS.d/3.11.0b1.rst
+++ b/Misc/NEWS.d/3.11.0b1.rst
@@ -58,10 +58,10 @@ may have prevented Python-to-Python calls respecting PEP 523.
.. nonce: -igcjS
.. section: Core and Builtins
-Add a closure keyword-only parameter to exec(). It can only be specified
+Add a closure keyword-only parameter to :func:`exec()`. It can only be specified
when exec-ing a code object that uses free variables. When specified, it
must be a tuple, with exactly the number of cell variables referenced by the
-code object. closure has a default value of None, and it must be None if the
+code object. closure has a default value of ``None``, and it must be ``None`` if the
code object doesn't refer to any free variables.
..
@@ -664,8 +664,9 @@ for :func:`os.fcopyfile` available in macOs.
.. nonce: l1p7CJ
.. section: Library
-For @dataclass, add weakref_slot. Default is False. If True, and if
-slots=True, add a slot named "__weakref__", which will allow instances to be
+For :func:`@dataclass <dataclasses.dataclass>`, add *weakref_slot*.
+The new parameter defaults to ``False``. If true, and if
+``slots=True``, add a slot named ``"__weakref__"``, which will allow instances to be
weakref'd. Contributed by Eric V. Smith
..
diff --git a/Misc/NEWS.d/3.12.0a1.rst b/Misc/NEWS.d/3.12.0a1.rst
index 8287038..583b7e4 100644
--- a/Misc/NEWS.d/3.12.0a1.rst
+++ b/Misc/NEWS.d/3.12.0a1.rst
@@ -3561,8 +3561,8 @@ with :func:`os.pidfd_open` in non-blocking mode. Patch by Kumar Aditya.
.. nonce: mkYl5q
.. section: Library
-Implement Enum __contains__ that returns True or False to replace the
-deprecated behaviour that would sometimes raise a TypeError.
+Implement ``Enum.__contains__`` that returns ``True`` or ``False`` to replace the
+deprecated behaviour that would sometimes raise a :exc:`TypeError`.
..
@@ -3729,7 +3729,7 @@ In a very special case, the email package tried to append the nonexistent
.. nonce: e6uKxj
.. section: Library
-Fix :func:`ast.unparse` when ``ImportFrom.level`` is None
+Fix :func:`ast.unparse` when ``ImportFrom.level`` is ``None``
..
@@ -3791,7 +3791,7 @@ the :c:type:`time_t` type in C.
.. section: Library
Fixed crash resulting from calling bisect.insort() or bisect.insort_left()
-with the key argument not equal to None.
+with the key argument not equal to ``None``.
..
@@ -4080,7 +4080,7 @@ replacement strings containing group references by 2--3 times.
.. section: Library
Fix findtext in the xml module to only give an empty string when the text
-attribute is set to None.
+attribute is set to ``None``.
..
diff --git a/Misc/NEWS.d/3.12.0a3.rst b/Misc/NEWS.d/3.12.0a3.rst
index ce128fd..9b789c6 100644
--- a/Misc/NEWS.d/3.12.0a3.rst
+++ b/Misc/NEWS.d/3.12.0a3.rst
@@ -496,7 +496,7 @@ Created packages from zipfile and test_zipfile modules, separating
Fix :attr:`~ipaddress.IPv4Address.is_private` properties in the
:mod:`ipaddress` module. Previously non-private networks (0.0.0.0/0) would
-return True from this method; now they correctly return False.
+return ``True`` from this method; now they correctly return ``False``.
..
diff --git a/Misc/NEWS.d/3.12.0a4.rst b/Misc/NEWS.d/3.12.0a4.rst
index 82faa5a..1599084 100644
--- a/Misc/NEWS.d/3.12.0a4.rst
+++ b/Misc/NEWS.d/3.12.0a4.rst
@@ -65,8 +65,8 @@ redundant.
.. nonce: M2n6Kg
.. section: Core and Builtins
-Fix :func:`int.__sizeof__` calculation to include the 1 element ob_digit
-array for 0 and False.
+Fix :func:`int.__sizeof__` calculation to include the 1-element ``ob_digit``
+array for ``0`` and ``False``.
..
diff --git a/Misc/NEWS.d/3.12.0b1.rst b/Misc/NEWS.d/3.12.0b1.rst
index 242a7f9..c5f32fb 100644
--- a/Misc/NEWS.d/3.12.0b1.rst
+++ b/Misc/NEWS.d/3.12.0b1.rst
@@ -395,7 +395,7 @@ Fix bug in line numbers of instructions emitted for :keyword:`except*
.. section: Core and Builtins
Clarify :exc:`SyntaxWarning` with literal ``is`` comparison by specifying
-which literal is problematic, since comparisons using ``is`` with e.g. None
+which literal is problematic, since comparisons using ``is`` with e.g. ``None``
and bool literals are idiomatic.
..