From e4b80a3bc6593d9f2e7217a666ea7aea36f2e7f0 Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Mon, 21 Feb 2022 00:25:57 -0800 Subject: [PATCH 1/6] Update platform.rst --- Doc/library/platform.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/library/platform.rst b/Doc/library/platform.rst index a0eece6c4d8aa0..ebab60fa3cbf6b 100644 --- a/Doc/library/platform.rst +++ b/Doc/library/platform.rst @@ -17,6 +17,11 @@ section. +.. note:: + + Calling a platform-specific method on a mismatched platform will return its default value. For example, calling :func:`win32_ver` on Linux will return ``('', '', '', '')``. + + Cross Platform -------------- From 53793ac61da075ec7c02991224cfbea43d444ffe Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Mon, 21 Feb 2022 01:31:11 -0800 Subject: [PATCH 2/6] Update platform.rst --- Doc/library/platform.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Doc/library/platform.rst b/Doc/library/platform.rst index ebab60fa3cbf6b..ff41da2b1d9c3f 100644 --- a/Doc/library/platform.rst +++ b/Doc/library/platform.rst @@ -19,7 +19,9 @@ .. note:: - Calling a platform-specific method on a mismatched platform will return its default value. For example, calling :func:`win32_ver` on Linux will return ``('', '', '', '')``. + Calling a platform-specific method on a mismatched platform will return its + default value. For example, calling :func:`win32_ver` on Linux will return + ``('', '', '', '')``. Cross Platform From 9de23e09ffd1d861e526f041a391d401ba5743b0 Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Mon, 28 Mar 2022 01:45:48 -0700 Subject: [PATCH 3/6] Change as per PR comments --- Doc/library/platform.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Doc/library/platform.rst b/Doc/library/platform.rst index ff41da2b1d9c3f..d9f3696c72d02b 100644 --- a/Doc/library/platform.rst +++ b/Doc/library/platform.rst @@ -19,9 +19,8 @@ .. note:: - Calling a platform-specific method on a mismatched platform will return its - default value. For example, calling :func:`win32_ver` on Linux will return - ``('', '', '', '')``. + Calling a platform-specific method on a mismatched platform will return their + default values, such as a tuple with empty string values. Cross Platform From d3d898dd559bf44a3d7b97f30576d18e7f559863 Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Sun, 10 Apr 2022 02:28:07 -0700 Subject: [PATCH 4/6] Remove starting note, added note on function defaults --- Doc/library/platform.rst | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Doc/library/platform.rst b/Doc/library/platform.rst index d9f3696c72d02b..9e959f59f83276 100644 --- a/Doc/library/platform.rst +++ b/Doc/library/platform.rst @@ -17,11 +17,6 @@ section. -.. note:: - - Calling a platform-specific method on a mismatched platform will return their - default values, such as a tuple with empty string values. - Cross Platform -------------- @@ -145,7 +140,7 @@ Cross Platform .. function:: release() - Returns the system's release, e.g. ``'2.2.0'`` or ``'NT'`` An empty string is + Returns the system's release, e.g. ``'2.2.0'`` or ``'NT'``. An empty string is returned if the value cannot be determined. @@ -182,7 +177,7 @@ Cross Platform Entries which cannot be determined are set to ``''``. .. versionchanged:: 3.3 - Result changed from a tuple to a namedtuple. + Result changed from a tuple to a :func:`~collections.namedtuple`. Java Platform @@ -207,7 +202,9 @@ Windows Platform Get additional version information from the Windows Registry and return a tuple ``(release, version, csd, ptype)`` referring to OS release, version number, - CSD level (service pack) and OS type (multi/single processor). + CSD level (service pack) and OS type (multi/single processor). Values which + cannot be determined are set to the defaults given as parameters (which all + default to ``''``). As a hint: *ptype* is ``'Uniprocessor Free'`` on single processor NT machines and ``'Multiprocessor Free'`` on multi processor machines. The *'Free'* refers @@ -217,9 +214,9 @@ Windows Platform .. function:: win32_edition() - Returns a string representing the current Windows edition. Possible - values include but are not limited to ``'Enterprise'``, ``'IoTUAP'``, - ``'ServerStandard'``, and ``'nanoserver'``. + Returns a string representing the current Windows edition, or ``None`` if the + value cannot be determined. Possible values include but are not limited to + ``'Enterprise'``, ``'IoTUAP'``, ``'ServerStandard'``, and ``'nanoserver'``. .. versionadded:: 3.8 From 9a6aa29bf7181efbed3fa8269776154ef1763047 Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Sun, 10 Apr 2022 02:29:00 -0700 Subject: [PATCH 5/6] Removed newline --- Doc/library/platform.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/Doc/library/platform.rst b/Doc/library/platform.rst index 9e959f59f83276..b7ac859402d345 100644 --- a/Doc/library/platform.rst +++ b/Doc/library/platform.rst @@ -17,7 +17,6 @@ section. - Cross Platform -------------- From 6d5dd15456481ba201b63dbc039040378b8067a9 Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Wed, 20 Apr 2022 00:52:02 -0700 Subject: [PATCH 6/6] Update Doc/library/platform.rst Co-authored-by: Victor Stinner --- Doc/library/platform.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/platform.rst b/Doc/library/platform.rst index b7ac859402d345..346063d66afab9 100644 --- a/Doc/library/platform.rst +++ b/Doc/library/platform.rst @@ -203,7 +203,7 @@ Windows Platform ``(release, version, csd, ptype)`` referring to OS release, version number, CSD level (service pack) and OS type (multi/single processor). Values which cannot be determined are set to the defaults given as parameters (which all - default to ``''``). + default to an empty string). As a hint: *ptype* is ``'Uniprocessor Free'`` on single processor NT machines and ``'Multiprocessor Free'`` on multi processor machines. The *'Free'* refers