Skip to content

gh-156491: Avoid KeyErrors in os._Environ.get() and __contains__() - #156492

Open
alexmalyshev wants to merge 2 commits into
python:mainfrom
alexmalyshev:environ-get
Open

gh-156491: Avoid KeyErrors in os._Environ.get() and __contains__()#156492
alexmalyshev wants to merge 2 commits into
python:mainfrom
alexmalyshev:environ-get

Conversation

@alexmalyshev

@alexmalyshev alexmalyshev commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Implement get() and __contains__() on os._Environ directly, which cuts out the cost of raising and catching a KeyError when the keys do not exist.

Implement get() and __contains__() on os._Environ directly, which cuts out the
cost of raising and catching a KeyError when the keys do not exist.
Comment thread Lib/os.py Outdated
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.

2 participants