Skip to content
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

Add os.environ.setdefault(str, str) functionality #585

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

avitkauskas
Copy link

Implements os.environ.setdefault(key, default = "") functionality as in python (closes #583).

Set the value of the key environment variable to default if it did not exist and return it.
Return the value from the environment if it was already set.

import os

a = os.environ.setdefault("A", "default_value")

Copy link

cla-bot bot commented Aug 27, 2024

Thank you for your pull request. We require contributors to agree to our Contributor License Agreement (https://exaloop.io/cla.txt), and we don't have @avitkauskas on file. In order for us to review and merge your code, please email info@exaloop.io to get yourself added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

os.environ.setdefault does not work
1 participant