gh-83940: os docs: Improve wording for getenv/getenvb (GH-98113)

(cherry picked from commit 187e853690)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2022-10-10 07:01:05 -07:00 committed by Pablo Galindo
parent e69136baff
commit 1f58d8ce78
No known key found for this signature in database
GPG key ID: FFE87404168BD847

View file

@ -299,8 +299,8 @@ process and user.
.. function:: getenv(key, default=None) .. function:: getenv(key, default=None)
Return the value of the environment variable *key* if it exists, or Return the value of the environment variable *key* as a string if it exists, or
*default* if it doesn't. *key*, *default* and the result are str. Note that *default* if it doesn't. *key* is a string. Note that
since :func:`getenv` uses :data:`os.environ`, the mapping of :func:`getenv` is since :func:`getenv` uses :data:`os.environ`, the mapping of :func:`getenv` is
similarly also captured on import, and the function may not reflect similarly also captured on import, and the function may not reflect
future environment changes. future environment changes.
@ -314,8 +314,8 @@ process and user.
.. function:: getenvb(key, default=None) .. function:: getenvb(key, default=None)
Return the value of the environment variable *key* if it exists, or Return the value of the environment variable *key* as bytes if it exists, or
*default* if it doesn't. *key*, *default* and the result are bytes. Note that *default* if it doesn't. *key* must be bytes. Note that
since :func:`getenvb` uses :data:`os.environb`, the mapping of :func:`getenvb` is since :func:`getenvb` uses :data:`os.environb`, the mapping of :func:`getenvb` is
similarly also captured on import, and the function may not reflect similarly also captured on import, and the function may not reflect
future environment changes. future environment changes.