From 5124524c88acf928f9ebe31dffa72f0e89326f34 Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Sat, 8 Oct 2022 18:50:44 -0700 Subject: [PATCH 1/2] Remove os.env/b default type constraint in docs --- Doc/library/os.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 8727f811def1c0..75f21d094b562e 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -305,7 +305,7 @@ process and user. .. function:: getenv(key, default=None) Return the value of the environment variable *key* if it exists, or - *default* if it doesn't. *key*, *default* and the result are str. Note that + *default* if it doesn't. *key* and the result are strings. Note that since :func:`getenv` uses :data:`os.environ`, the mapping of :func:`getenv` is similarly also captured on import, and the function may not reflect future environment changes. @@ -320,7 +320,7 @@ process and user. .. function:: getenvb(key, default=None) Return the value of the environment variable *key* if it exists, or - *default* if it doesn't. *key*, *default* and the result are bytes. Note that + *default* if it doesn't. *key* and the result are bytes. Note that since :func:`getenvb` uses :data:`os.environb`, the mapping of :func:`getenvb` is similarly also captured on import, and the function may not reflect future environment changes. From 435963a4aa6fc35c4ef917a430743fd8e1b8d9f4 Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Sun, 9 Oct 2022 21:40:37 -0700 Subject: [PATCH 2/2] Correct wording of default type --- Doc/library/os.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 75f21d094b562e..43066fa1e13d74 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -304,8 +304,8 @@ process and user. .. function:: getenv(key, default=None) - Return the value of the environment variable *key* if it exists, or - *default* if it doesn't. *key* and the result are strings. Note that + Return the value of the environment variable *key* as a string if it exists, or + *default* if it doesn't. *key* is a string. Note that since :func:`getenv` uses :data:`os.environ`, the mapping of :func:`getenv` is similarly also captured on import, and the function may not reflect future environment changes. @@ -319,8 +319,8 @@ process and user. .. function:: getenvb(key, default=None) - Return the value of the environment variable *key* if it exists, or - *default* if it doesn't. *key* and the result are bytes. Note that + Return the value of the environment variable *key* as bytes if it exists, or + *default* if it doesn't. *key* must be bytes. Note that since :func:`getenvb` uses :data:`os.environb`, the mapping of :func:`getenvb` is similarly also captured on import, and the function may not reflect future environment changes.