]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-95454: Replace truthy/falsy with true/false (GH-95456)
authorRobert O'Shea <PurityLake@users.noreply.github.com>
Sat, 30 Jul 2022 07:42:21 +0000 (08:42 +0100)
committerGitHub <noreply@github.com>
Sat, 30 Jul 2022 07:42:21 +0000 (00:42 -0700)
Doc/library/logging.rst
Lib/logging/__init__.py
Lib/test/test_unittest/test_result.py
Misc/NEWS.d/3.5.1rc1.rst
Misc/NEWS.d/3.5.3rc1.rst
Misc/NEWS.d/3.6.0b2.rst
Misc/NEWS.d/3.7.0a1.rst
Misc/NEWS.d/next/Documentation/2022-07-30-00-23-11.gh-issue-95454.we7AFm.rst [new file with mode: 0644]

index 9bfed4352a19553144123b55d9dcffa56c6c5dad..8ec1eda32b1531ea541df657f7e2279fa10dac45 100644 (file)
@@ -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.
index 88953fefb7447697afa3e56b9e59923d48d16248..dc28702f50048ab437e5d2798efe7ab35c1ff002 100644 (file)
@@ -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):
index eeb15992fd109cf6dcf8d14dffe2a9f092ac9907..e71d114751d94d89cf34b1f491febd0ec9aa7d3e 100644 (file)
@@ -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):
index d06817ccb950ec179cf3840455688a55bfd9f740..dc247ce2096a7db03a39ec75bb6ad5a55ef3445c 100644 (file)
@@ -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.
 
 ..
index 2307fccbf6f92d2cbeb30d32ff93c609fca658a2..bf4ef9302c9d1d567dc0c6094f3a493b46921e94 100644 (file)
@@ -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().
 
 ..
 
index 627465e887bc185523f2906c1fd24535e8bf7ba8..9413c6e01917d5c4bf7b402543bd7d6cb5c95025 100644 (file)
@@ -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().
 
 ..
 
index e99c45ec7fdaadf8fbc6ceaa0ebb185f48175abd..9bada1b76be7a8606d214b9b6e1626d8e0842220 100644 (file)
@@ -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 (file)
index 0000000..6440c23
--- /dev/null
@@ -0,0 +1,2 @@
+Replaced incorrectly written true/false values
+in documentiation. Patch by Robert O'Shea