Skip to content

Commit

Permalink
pythongh-91038: Change default argument value to False instead of `…
Browse files Browse the repository at this point in the history
…0` (python#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>
  • Loading branch information
3 people authored Feb 27, 2023
1 parent 8d0f09b commit f3cb15c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Doc/library/platform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Lib/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 :).
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:meth:`platform.platform` now has boolean default arguments.

0 comments on commit f3cb15c

Please sign in to comment.