summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert O'Shea <PurityLake@users.noreply.github.com>2022-07-30 07:42:21 (GMT)
committerGitHub <noreply@github.com>2022-07-30 07:42:21 (GMT)
commitcd26595232ac1b5061460d5949d5204c90287c1c (patch)
tree90bce447159930a1e81948f99297492020c37232
parent0956b6d9c44f66cc152c6afe22a3793e5b157cfd (diff)
downloadcpython-cd26595232ac1b5061460d5949d5204c90287c1c.zip
cpython-cd26595232ac1b5061460d5949d5204c90287c1c.tar.gz
cpython-cd26595232ac1b5061460d5949d5204c90287c1c.tar.bz2
gh-95454: Replace truthy/falsy with true/false (GH-95456)
-rw-r--r--Doc/library/logging.rst2
-rw-r--r--Lib/logging/__init__.py12
-rw-r--r--Lib/test/test_unittest/test_result.py4
-rw-r--r--Misc/NEWS.d/3.5.1rc1.rst2
-rw-r--r--Misc/NEWS.d/3.5.3rc1.rst2
-rw-r--r--Misc/NEWS.d/3.6.0b2.rst2
-rw-r--r--Misc/NEWS.d/3.7.0a1.rst2
-rw-r--r--Misc/NEWS.d/next/Documentation/2022-07-30-00-23-11.gh-issue-95454.we7AFm.rst2
8 files changed, 15 insertions, 13 deletions
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst
index 9bfed43..8ec1eda 100644
--- a/Doc/library/logging.rst
+++ b/Doc/library/logging.rst
@@ -672,7 +672,7 @@ empty string, all events are passed.
.. method:: filter(record)
- Is the specified record to be logged? Returns falsy for no, truthy for
+ Is the specified record to be logged? Returns false for no, true for
yes. Filters can either modify log records in-place or return a completely
different record instance which will replace the original
log record in any future processing of the event.
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 88953fe..dc28702 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -833,17 +833,17 @@ class Filterer(object):
Determine if a record is loggable by consulting all the filters.
The default is to allow the record to be logged; any filter can veto
- this by returning a falsy value.
+ this by returning a false value.
If a filter attached to a handler returns a log record instance,
then that instance is used in place of the original log record in
any further processing of the event by that handler.
- If a filter returns any other truthy value, the original log record
+ If a filter returns any other true value, the original log record
is used in any further processing of the event by that handler.
- If none of the filters return falsy values, this method returns
+ If none of the filters return false values, this method returns
a log record.
- If any of the filters return a falsy value, this method returns
- a falsy value.
+ If any of the filters return a false value, this method returns
+ a false value.
.. versionchanged:: 3.2
@@ -1017,7 +1017,7 @@ class Handler(Filterer):
the I/O thread lock.
Returns an instance of the log record that was emitted
- if it passed all filters, otherwise a falsy value is returned.
+ if it passed all filters, otherwise a false value is returned.
"""
rv = self.filter(record)
if isinstance(rv, LogRecord):
diff --git a/Lib/test/test_unittest/test_result.py b/Lib/test/test_unittest/test_result.py
index eeb1599..e71d114 100644
--- a/Lib/test/test_unittest/test_result.py
+++ b/Lib/test/test_unittest/test_result.py
@@ -449,8 +449,8 @@ class Test_TextTestResult(unittest.TestCase):
'(' + __name__ + '.Test_TextTestResult.testGetSubTestDescriptionWithoutDocstringAndParams) '
'(<subtest>)')
- def testGetSubTestDescriptionForFalsyValues(self):
- expected = 'testGetSubTestDescriptionForFalsyValues (%s.Test_TextTestResult.testGetSubTestDescriptionForFalsyValues) [%s]'
+ def testGetSubTestDescriptionForFalseValues(self):
+ expected = 'testGetSubTestDescriptionForFalseValues (%s.Test_TextTestResult.testGetSubTestDescriptionForFalseValues) [%s]'
result = unittest.TextTestResult(None, True, 1)
for arg in [0, None, []]:
with self.subTest(arg):
diff --git a/Misc/NEWS.d/3.5.1rc1.rst b/Misc/NEWS.d/3.5.1rc1.rst
index d06817c..dc247ce 100644
--- a/Misc/NEWS.d/3.5.1rc1.rst
+++ b/Misc/NEWS.d/3.5.1rc1.rst
@@ -900,7 +900,7 @@ Kurenkov.
.. nonce: QhQ9RD
.. section: Library
-Fixed functools.singledispatch on classes with falsy metaclasses. Patch by
+Fixed functools.singledispatch on classes with false metaclasses. Patch by
Ethan Furman.
..
diff --git a/Misc/NEWS.d/3.5.3rc1.rst b/Misc/NEWS.d/3.5.3rc1.rst
index 2307fcc..bf4ef93 100644
--- a/Misc/NEWS.d/3.5.3rc1.rst
+++ b/Misc/NEWS.d/3.5.3rc1.rst
@@ -832,7 +832,7 @@ In the traceback module, restore the formatting of exception messages like
.. nonce: 3UhyPo
.. section: Library
-Allow falsy values to be used for msg parameter of subTest().
+Allow false values to be used for msg parameter of subTest().
..
diff --git a/Misc/NEWS.d/3.6.0b2.rst b/Misc/NEWS.d/3.6.0b2.rst
index 627465e..9413c6e 100644
--- a/Misc/NEWS.d/3.6.0b2.rst
+++ b/Misc/NEWS.d/3.6.0b2.rst
@@ -460,7 +460,7 @@ In the traceback module, restore the formatting of exception messages like
.. nonce: 3UhyPo
.. section: Library
-Allow falsy values to be used for msg parameter of subTest().
+Allow false values to be used for msg parameter of subTest().
..
diff --git a/Misc/NEWS.d/3.7.0a1.rst b/Misc/NEWS.d/3.7.0a1.rst
index e99c45e..9bada1b 100644
--- a/Misc/NEWS.d/3.7.0a1.rst
+++ b/Misc/NEWS.d/3.7.0a1.rst
@@ -4453,7 +4453,7 @@ In the traceback module, restore the formatting of exception messages like
.. nonce: 3UhyPo
.. section: Library
-Allow falsy values to be used for msg parameter of subTest().
+Allow false values to be used for msg parameter of subTest().
..
diff --git a/Misc/NEWS.d/next/Documentation/2022-07-30-00-23-11.gh-issue-95454.we7AFm.rst b/Misc/NEWS.d/next/Documentation/2022-07-30-00-23-11.gh-issue-95454.we7AFm.rst
new file mode 100644
index 0000000..6440c23
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2022-07-30-00-23-11.gh-issue-95454.we7AFm.rst
@@ -0,0 +1,2 @@
+Replaced incorrectly written true/false values
+in documentiation. Patch by Robert O'Shea