codon icon indicating copy to clipboard operation
codon copied to clipboard

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

Open avitkauskas opened this issue 1 year ago • 1 comments

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

avitkauskas avatar Aug 27 '24 19:08 avitkauskas

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[bot] avatar Aug 27 '24 19:08 cla-bot[bot]