Skip to content

Commit 3ec1124

Browse files
bpo-45600: Enhanced / clarified the docs for os.environ and os.environb (GH-29204) (GH-29321)
Co-authored-by: Łukasz Langa <[email protected]> (cherry picked from commit b17cfd1) Co-authored-by: andrei kulakov <[email protected]>
1 parent e156031 commit 3ec1124

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Doc/library/os.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,10 @@ process and user.
102102

103103
.. data:: environ
104104

105-
A :term:`mapping` object representing the string environment. For example,
106-
``environ['HOME']`` is the pathname of your home directory (on some platforms),
107-
and is equivalent to ``getenv("HOME")`` in C.
105+
A :term:`mapping` object where keys and values are strings that represent
106+
the process environment. For example, ``environ['HOME']`` is the pathname
107+
of your home directory (on some platforms), and is equivalent to
108+
``getenv("HOME")`` in C.
108109

109110
This mapping is captured the first time the :mod:`os` module is imported,
110111
typically during Python startup as part of processing :file:`site.py`. Changes
@@ -141,10 +142,10 @@ process and user.
141142

142143
.. data:: environb
143144

144-
Bytes version of :data:`environ`: a :term:`mapping` object representing the
145-
environment as byte strings. :data:`environ` and :data:`environb` are
146-
synchronized (modify :data:`environb` updates :data:`environ`, and vice
147-
versa).
145+
Bytes version of :data:`environ`: a :term:`mapping` object where both keys
146+
and values are :class:`bytes` objects representing the process environment.
147+
:data:`environ` and :data:`environb` are synchronized (modifying
148+
:data:`environb` updates :data:`environ`, and vice versa).
148149

149150
:data:`environb` is only available if :data:`supports_bytes_environ` is
150151
``True``.

0 commit comments

Comments
 (0)