]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-91038: Change default argument value to `False` instead of `0` (#31621)
authorRotzbua <Rotzbua@users.noreply.github.com>
Mon, 27 Feb 2023 02:10:34 +0000 (03:10 +0100)
committerGitHub <noreply@github.com>
Mon, 27 Feb 2023 02:10:34 +0000 (18:10 -0800)
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`.

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Doc/library/platform.rst
Lib/platform.py
Misc/NEWS.d/next/Library/2023-02-26-12-37-17.gh-issue-91038.S4rFH_.rst [new file with mode: 0644]

index a0c9f63ab9f9573c776a685b056699509874f381..69c4dfc422c98e9e5c8fca24a6b7331fe8069f09 100644 (file)
@@ -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.
index 2dfaf76252db51257a2519255f55128a3434d16b..f2b0d1d1bd3f5dbb9625166cce8eaa3d5c7ab687 100755 (executable)
@@ -1246,7 +1246,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 :).
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 (file)
index 0000000..2667ff1
--- /dev/null
@@ -0,0 +1 @@
+:meth:`platform.platform` now has boolean default arguments.