[Python-checkins] bpo-45600: Enhanced / clarified the docs for os.environ and os.environb (GH-29204) (GH-29321)
ambv
webhook-mailer at python.org
Fri Oct 29 16:53:10 EDT 2021
https://github.com/python/cpython/commit/3ec1124de289496efabc43a02cc88b3c59e1e238
commit: 3ec1124de289496efabc43a02cc88b3c59e1e238
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: ambv <lukasz at langa.pl>
date: 2021-10-29T22:52:59+02:00
summary:
bpo-45600: Enhanced / clarified the docs for os.environ and os.environb (GH-29204) (GH-29321)
Co-authored-by: Łukasz Langa <lukasz at langa.pl>
(cherry picked from commit b17cfd150f4dc2816975d304a71110a2d445eaf0)
Co-authored-by: andrei kulakov <andrei.avk at gmail.com>
files:
M Doc/library/os.rst
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 23e220c009d30..d4cc296fbf89a 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -102,9 +102,10 @@ process and user.
.. data:: environ
- A :term:`mapping` object representing the string environment. For example,
- ``environ['HOME']`` is the pathname of your home directory (on some platforms),
- and is equivalent to ``getenv("HOME")`` in C.
+ A :term:`mapping` object where keys and values are strings that represent
+ the process environment. For example, ``environ['HOME']`` is the pathname
+ of your home directory (on some platforms), and is equivalent to
+ ``getenv("HOME")`` in C.
This mapping is captured the first time the :mod:`os` module is imported,
typically during Python startup as part of processing :file:`site.py`. Changes
@@ -141,10 +142,10 @@ process and user.
.. data:: environb
- Bytes version of :data:`environ`: a :term:`mapping` object representing the
- environment as byte strings. :data:`environ` and :data:`environb` are
- synchronized (modify :data:`environb` updates :data:`environ`, and vice
- versa).
+ Bytes version of :data:`environ`: a :term:`mapping` object where both keys
+ and values are :class:`bytes` objects representing the process environment.
+ :data:`environ` and :data:`environb` are synchronized (modifying
+ :data:`environb` updates :data:`environ`, and vice versa).
:data:`environb` is only available if :data:`supports_bytes_environ` is
``True``.
More information about the Python-checkins
mailing list