File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,6 +61,13 @@ Notes on the availability of these functions:
6161 names have currently been registered: ``'posix' ``, ``'nt' ``, ``'mac' ``,
6262 ``'os2' ``, ``'ce' ``, ``'java' ``.
6363
64+ .. seealso ::
65+ :attr: `sys.platform ` has a finer granularity. :func: `os.uname ` gives
66+ system-dependent version information.
67+
68+ The :mod: `platform ` module provides detailed checks for the
69+ system's identity.
70+
6471
6572.. _os-filenames :
6673
Original file line number Diff line number Diff line change @@ -714,6 +714,12 @@ always available.
714714 For Unix systems, this is the lowercased OS name as returned by ``uname -s ``
715715 with the first part of the version as returned by ``uname -r `` appended,
716716 e.g. ``'sunos5' `` or ``'linux2' ``, *at the time when Python was built *.
717+ Unless you want to test for a specific system version, it is therefore
718+ recommended to use the following idiom::
719+
720+ if sys.platform.startswith('linux'):
721+ # Linux-specific code here...
722+
717723 For other systems, the values are:
718724
719725 ================ ===========================
@@ -726,6 +732,12 @@ always available.
726732 OS/2 EMX ``'os2emx' ``
727733 ================ ===========================
728734
735+ .. seealso ::
736+ :attr: `os.name ` has a coarser granularity. :func: `os.uname ` gives
737+ system-dependent version information.
738+
739+ The :mod: `platform ` module provides detailed checks for the
740+ system's identity.
729741
730742.. data :: prefix
731743
You can’t perform that action at this time.
0 commit comments