From 513d84d621eee9ca41f867004cf308fed6bea873 Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Mon, 28 Feb 2022 19:23:47 +0100 Subject: [PATCH 1/2] Change default argument value to `False` instead of `0` The argument is used as a switch and corresponds to a boolean logic. Therefore it is more intuitive to use the corresponding constant `False` as default value instead of the integer `0`. --- Doc/library/platform.rst | 2 +- Lib/platform.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/platform.rst b/Doc/library/platform.rst index a0eece6c4d8aa0..bd922af076b35c 100644 --- a/Doc/library/platform.rst +++ b/Doc/library/platform.rst @@ -63,7 +63,7 @@ Cross Platform string is returned if the value cannot be determined. -.. function:: platform(aliased=0, terse=0) +.. function:: platform(aliased=False, terse=False) Returns a single string identifying the underlying platform with as much useful information as possible. diff --git a/Lib/platform.py b/Lib/platform.py index 3f3f25a2c92d3b..da938c64693465 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -1176,7 +1176,7 @@ def python_compiler(): _platform_cache = {} -def platform(aliased=0, terse=0): +def platform(aliased=False, terse=False): """ Returns a single string identifying the underlying platform with as much useful information as possible (but no more :). From 5de86ddc3d2dd89ac244d2a297423d75b824c448 Mon Sep 17 00:00:00 2001 From: Oleg Iarygin Date: Sun, 26 Feb 2023 12:37:29 +0400 Subject: [PATCH 2/2] Add a news entry --- .../next/Library/2023-02-26-12-37-17.gh-issue-91038.S4rFH_.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2023-02-26-12-37-17.gh-issue-91038.S4rFH_.rst diff --git a/Misc/NEWS.d/next/Library/2023-02-26-12-37-17.gh-issue-91038.S4rFH_.rst b/Misc/NEWS.d/next/Library/2023-02-26-12-37-17.gh-issue-91038.S4rFH_.rst new file mode 100644 index 00000000000000..2667ff120fd402 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2023-02-26-12-37-17.gh-issue-91038.S4rFH_.rst @@ -0,0 +1 @@ +:meth:`platform.platform` now has boolean default arguments.