-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Enhance test.support.os_helper.EnvironmentVarGuard
interface
#131277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Ok, nvm actually |
picnixz
added a commit
that referenced
this issue
Mar 16, 2025
…ment variable at once (#131280) Co-authored-by: Hugo van Kemenade <[email protected]>
Keeping the issue opened until we decide whether to backport this or not to ease future backports. |
plashchynski
pushed a commit
to plashchynski/cpython
that referenced
this issue
Mar 17, 2025
…nvironment variable at once (python#131280) Co-authored-by: Hugo van Kemenade <[email protected]>
Adding the version labels as I decided to backport this to ease future development. However, the API will not be publicly documented. |
picnixz
added a commit
to picnixz/cpython
that referenced
this issue
Mar 18, 2025
…nvironment variable at once (python#131280) Co-authored-by: Hugo van Kemenade <[email protected]>
picnixz
added a commit
to picnixz/cpython
that referenced
this issue
Mar 18, 2025
…nvironment variable at once (python#131280) Co-authored-by: Hugo van Kemenade <[email protected]>
picnixz
added a commit
that referenced
this issue
Mar 18, 2025
…vironment variable at once (GH-131280) (#131410) (cherry picked from commit 3185e31) --------- Co-authored-by: Hugo van Kemenade <[email protected]>
picnixz
added a commit
that referenced
this issue
Mar 18, 2025
…vironment variable at once (GH-131280) (#131409) (cherry picked from commit 3185e31) --------- Co-authored-by: Hugo van Kemenade <[email protected]>
seehwan
pushed a commit
to seehwan/cpython
that referenced
this issue
Apr 16, 2025
…nvironment variable at once (python#131280) Co-authored-by: Hugo van Kemenade <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Feature or enhancement
Currently, we have a lot of pattern of the form:
I think it makes sense to have something like this:
or to also provide a decorator-based approach when the values to set/unset are statically known.
Features
env.unset(k1, k2, ...)
Some optional features that I rejected after looking at the use cases:
I plan to create a PR today or tomorrow to illustrate the new interface.
EDIT: no need to the support for setting multiple variables at once because
EnvironmentVarGuard
is a mapping, so it has.update()
which does the trick.Linked PRs
EnvironmentVarGuard
to unset more than one environment variable at once #131280See #131277 (comment) for the version labels rationale and #131280 (comment) for the backporte rationale.
The text was updated successfully, but these errors were encountered: