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

Skip to content

Commit 21f93b6

Browse files
committed
Merge remote-tracking branch 'upstream/main' into pep649-compile
2 parents 517fb56 + 6efe346 commit 21f93b6

21 files changed

+886
-41
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ Doc/howto/clinic.rst @erlend-aasland
245245
**/*interpreteridobject.* @ericsnowcurrently
246246
**/*crossinterp* @ericsnowcurrently
247247
Lib/test/support/interpreters/ @ericsnowcurrently
248-
Modules/_xx*interp*module.c @ericsnowcurrently
248+
Modules/_interp*module.c @ericsnowcurrently
249249
Lib/test/test_interpreters/ @ericsnowcurrently
250250

251251
# Android

Doc/library/os.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ process and user.
193193
to the environment made after this time are not reflected in :data:`os.environ`,
194194
except for changes made by modifying :data:`os.environ` directly.
195195

196+
The :meth:`!os.environ.refresh()` method updates :data:`os.environ` with
197+
changes to the environment made by :func:`os.putenv`, by
198+
:func:`os.unsetenv`, or made outside Python in the same process.
199+
196200
This mapping may be used to modify the environment as well as query the
197201
environment. :func:`putenv` will be called automatically when the mapping
198202
is modified.
@@ -225,6 +229,9 @@ process and user.
225229
.. versionchanged:: 3.9
226230
Updated to support :pep:`584`'s merge (``|``) and update (``|=``) operators.
227231

232+
.. versionchanged:: 3.14
233+
Added the :meth:`!os.environ.refresh()` method.
234+
228235

229236
.. data:: environb
230237

@@ -561,6 +568,8 @@ process and user.
561568
of :data:`os.environ`. This also applies to :func:`getenv` and :func:`getenvb`, which
562569
respectively use :data:`os.environ` and :data:`os.environb` in their implementations.
563570

571+
See also the :data:`os.environ.refresh() <os.environ>` method.
572+
564573
.. note::
565574

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

821+
See also the :data:`os.environ.refresh() <os.environ>` method.
822+
812823
.. audit-event:: os.unsetenv key os.unsetenv
813824

814825
.. versionchanged:: 3.9

Doc/whatsnew/3.14.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ ast
9292
Added :func:`ast.compare` for comparing two ASTs.
9393
(Contributed by Batuhan Taskaya and Jeremy Hylton in :issue:`15987`.)
9494

95+
os
96+
--
97+
98+
* Added the :data:`os.environ.refresh() <os.environ>` method to update
99+
:data:`os.environ` with changes to the environment made by :func:`os.putenv`,
100+
by :func:`os.unsetenv`, or made outside Python in the same process.
101+
(Contributed by Victor Stinner in :gh:`120057`.)
95102

96103

97104
Optimizations

InternalDocs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ it is not, please report that through the
1212
[issue tracker](https://github.com/python/cpython/issues).
1313

1414

15+
[Compiler Design](compiler.md)
16+
1517
[Exception Handling](exception_handling.md)
1618

1719
[Adaptive Instruction Families](adaptive.md)

0 commit comments

Comments
 (0)