Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Next Next commit
doc: add links to refresh method
  • Loading branch information
vstinner committed Jun 10, 2024
commit 64c415d746d4269157e4804c2af696a0e8c4fb3e
4 changes: 4 additions & 0 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,8 @@ process and user.
of :data:`os.environ`. This also applies to :func:`getenv` and :func:`getenvb`, which
respectively use :data:`os.environ` and :data:`os.environb` in their implementations.

See also the :data:`os.environ.refresh() <os.environ>` method.

.. note::

On some platforms, including FreeBSD and macOS, setting ``environ`` may
Expand Down Expand Up @@ -816,6 +818,8 @@ process and user.
don't update :data:`os.environ`, so it is actually preferable to delete items of
:data:`os.environ`.

See also the :data:`os.environ.refresh() <os.environ>` method.

.. audit-event:: os.unsetenv key os.unsetenv

.. versionchanged:: 3.9
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Added :func:`ast.compare` for comparing two ASTs.
os
--

* Added the :meth:`os.environ.refresh() <os.environ>` method to update
* Added the :data:`os.environ.refresh() <os.environ>` method to update
:data:`os.environ` with changes to the environment made by :func:`os.putenv`,
by :func:`os.unsetenv`, or made outside Python in the same process.
(Contributed by Victor Stinner in :gh:`120057`.)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Added the :meth:`os.environ.refresh() <os.environ>` method to update
Added the :data:`os.environ.refresh() <os.environ>` method to update
:data:`os.environ` with changes to the environment made by :func:`os.putenv`,
by :func:`os.unsetenv`, or made outside Python in the same process.
Patch by Victor Stinner.