Skip to content

Commit b17cfd1

Browse files
akulakovambv
andauthored
bpo-45600: Enhanced / clarified the docs for os.environ and os.environb (pythonGH-29204)
Co-authored-by: Łukasz Langa <[email protected]>
1 parent 3877fc0 commit b17cfd1

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
@@ -170,9 +170,10 @@ process and user.
170170

171171
.. data:: environ
172172

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

177178
This mapping is captured the first time the :mod:`os` module is imported,
178179
typically during Python startup as part of processing :file:`site.py`. Changes
@@ -209,10 +210,10 @@ process and user.
209210

210211
.. data:: environb
211212

212-
Bytes version of :data:`environ`: a :term:`mapping` object representing the
213-
environment as byte strings. :data:`environ` and :data:`environb` are
214-
synchronized (modify :data:`environb` updates :data:`environ`, and vice
215-
versa).
213+
Bytes version of :data:`environ`: a :term:`mapping` object where both keys
214+
and values are :class:`bytes` objects representing the process environment.
215+
:data:`environ` and :data:`environb` are synchronized (modifying
216+
:data:`environb` updates :data:`environ`, and vice versa).
216217

217218
:data:`environb` is only available if :data:`supports_bytes_environ` is
218219
``True``.

0 commit comments

Comments
 (0)