Skip to content

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")

@cla-bot
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 [email protected] to get yourself added.

@cla-bot cla-bot bot added the cla-signed label Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

os.environ.setdefault does not work

1 participant