Skip to content

bpo-46882: Clarify argument type of platform.platform(aliased, terse) to boolean #31617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Doc/library/platform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,20 @@ 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.

The output is intended to be *human readable* rather than machine parseable. It
may look different on different platforms and this is intended.

If *aliased* is true, the function will use aliases for various platforms that
If *aliased* is ``True``, the function will use aliases for various platforms that
report system names which differ from their common names, for example SunOS will
be reported as Solaris. The :func:`system_alias` function is used to implement
this.

Setting *terse* to true causes the function to return only the absolute minimum
Setting *terse* to ``True`` causes the function to return only the absolute minimum
information needed to identify the platform.

.. versionchanged:: 3.8
Expand Down
6 changes: 3 additions & 3 deletions Lib/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 :).
Expand All @@ -1185,13 +1185,13 @@ def platform(aliased=0, terse=0):
machine parseable. It may look different on different
platforms and this is intended.

If "aliased" is true, the function will use aliases for
If "aliased" is True, the function will use aliases for
various platforms that report system names which differ from
their common names, e.g. SunOS will be reported as
Solaris. The system_alias() function is used to implement
this.

Setting terse to true causes the function to return only the
Setting terse to True causes the function to return only the
absolute minimum information needed to identify the platform.

"""
Expand Down