diff options
author | Rotzbua <Rotzbua@users.noreply.github.com> | 2023-02-27 02:10:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-27 02:10:34 (GMT) |
commit | f3cb15c88afa2e87067de3c6106664b3f7cd4035 (patch) | |
tree | b92288b92447fbf4d78e6fb702b36d7bb7bde6d0 | |
parent | 8d0f09b1beafd95763a5da53acc58dac0bd63a53 (diff) | |
download | cpython-f3cb15c88afa2e87067de3c6106664b3f7cd4035.zip cpython-f3cb15c88afa2e87067de3c6106664b3f7cd4035.tar.gz cpython-f3cb15c88afa2e87067de3c6106664b3f7cd4035.tar.bz2 |
gh-91038: Change default argument value to `False` instead of `0` (#31621)
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>
-rw-r--r-- | Doc/library/platform.rst | 2 | ||||
-rwxr-xr-x | Lib/platform.py | 2 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Library/2023-02-26-12-37-17.gh-issue-91038.S4rFH_.rst | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/Doc/library/platform.rst b/Doc/library/platform.rst index a0c9f63..69c4dfc 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 2dfaf76..f2b0d1d 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -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 index 0000000..2667ff1 --- /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. |