Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
python
/
cpython
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
36.8k
Star
77.3k
Code
Issues
5k+
Pull requests
2.7k
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Commits
Breadcrumbs
History for
cpython
Doc
library
contextlib.rst
on
3.9
User selector
All users
Datepicker
All time
Commit history
Commits on Mar 28, 2022
bpo-28516: document contextlib.ExitStack.__enter__ behavior (GH-31636) (GH-32145)
Show description for 1e3132b
3 people
authored
1e3132b
View commit details
Copy full SHA for 1e3132b
View code at this point
Browse repository at this point
Commits on Jul 30, 2021
[3.9] Update URLs in comments and metadata to use HTTPS (GH-27458) (GH-27480)
Show description for 168879e
ambv
and
coderanger
authored
168879e
View commit details
Copy full SHA for 168879e
View code at this point
Browse repository at this point
Commits on Jun 4, 2021
bpo-44279: revert 'exceptions are raised' back to 'exceptions occur' (GH-26492) (GH-26539)
Show description for ea298e1
miss-islington
and
iritkatriel
authored
ea298e1
View commit details
Copy full SHA for ea298e1
View code at this point
Browse repository at this point
Commits on Jun 1, 2021
[3.9] bpo-44279: [doc] reword contextlib.suppress documentation (GH-26428) (GH-26481)
Show description for 9a68862
iritkatriel
and
MapleCCC
authored
9a68862
View commit details
Copy full SHA for 9a68862
View code at this point
Browse repository at this point
Commits on May 26, 2021
bpo-41147: [doc] contextlib.redirect_stdout() provides the new stream as context var (GH-21199) (GH-26380)
Show description for bee66d3
miss-islington
and
PeterJCLaw
authored
bee66d3
View commit details
Copy full SHA for bee66d3
View code at this point
Browse repository at this point
Commits on May 19, 2021
bpo-40975: [doc] Identify AsyncExitStack.enter_async_context()/aclose() as coroutine methods (GH-20870) (GH-26255)
Show description for 9a75cc6
miss-islington
and
naglis
authored
9a75cc6
View commit details
Copy full SHA for 9a75cc6
View code at this point
Browse repository at this point
Commits on Apr 26, 2021
Use the zero argument form of super() in examples for Python3 docs. (GH-22314) (GH-25638)
Show description for c816c1c
miss-islington
and
andresdelfino
authored
c816c1c
View commit details
Copy full SHA for c816c1c
View code at this point
Browse repository at this point
Commits on Jun 5, 2019
[3.9] bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-12620)
Show description for 142566c
serhiy-storchaka
authored
142566c
View commit details
Copy full SHA for 142566c
View code at this point
Browse repository at this point
Commits on Jun 1, 2019
bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700)
serhiy-storchaka
authored
2085bd0
View commit details
Copy full SHA for 2085bd0
View code at this point
Browse repository at this point
Commits on Dec 19, 2018
bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174)
serhiy-storchaka
authored
2b57c43
View commit details
Copy full SHA for 2b57c43
View code at this point
Browse repository at this point
Commits on Sep 18, 2018
Clarify that AsyncExitStack works with coroutine functions (GH-9405)
Show description for a3c88ef
njsmith
authored and
willingc
committed
a3c88ef
View commit details
Copy full SHA for a3c88ef
View code at this point
Browse repository at this point
Commits on Aug 25, 2018
Fixed typo with asynccontextmanager code example (GH-8845)
Show description for 416cbce
alvassin
authored and
Mariatta
committed
416cbce
View commit details
Copy full SHA for 416cbce
View code at this point
Browse repository at this point
Commits on Jul 23, 2018
bpo-33468: Add try-finally contextlib.contextmanager example (GH-7816)
Carreau
authored and
taleinat
committed
bde782b
View commit details
Copy full SHA for bde782b
View code at this point
Browse repository at this point
Commits on Jul 9, 2018
bpo-34067: Include a more easily understood example for nullcontext (GH-8158)
Show description for c287545
banool
authored and
ncoghlan
committed
c287545
View commit details
Copy full SHA for c287545
View code at this point
Browse repository at this point
Commits on Jan 25, 2018
bpo-29302: Implement contextlib.AsyncExitStack. (#4790)
Kentzo
authored and
Yury Selivanov
committed
1aa094f
View commit details
Copy full SHA for 1aa094f
View code at this point
Browse repository at this point
Commits on Dec 14, 2017
bpo-30241: implement contextlib.AbstractAsyncContextManager (#1412)
JelleZijlstra
authored and
Yury Selivanov
committed
176baa3
View commit details
Copy full SHA for 176baa3
View code at this point
Browse repository at this point
Commits on Nov 23, 2017
bpo-10049: Add a "no-op" (null) context manager to contextlib (GH-4464)
Show description for 0784a2e
Jesse-Bakker
authored and
ncoghlan
committed
0784a2e
View commit details
Copy full SHA for 0784a2e
View code at this point
Browse repository at this point
Commits on May 1, 2017
bpo-29679: Implement @contextlib.asynccontextmanager (#360)
JelleZijlstra
authored and
1st1
committed
2e62469
View commit details
Copy full SHA for 2e62469
View code at this point
Browse repository at this point
Commits on Aug 31, 2016
Closes #27904: Improved logging statements to defer formatting until needed.
vsajip
committed
dd917f8
View commit details
Copy full SHA for dd917f8
View code at this point
Browse repository at this point
Commits on Jun 9, 2016
Add a missing :term:.
brettcannon
committed
516f546
View commit details
Copy full SHA for 516f546
View code at this point
Browse repository at this point
Commits on May 10, 2016
Issue #23921: Standardized documentation whitespace formatting.
Show description for c499f30
serhiy-storchaka
committed
c499f30
View commit details
Copy full SHA for c499f30
View code at this point
Browse repository at this point
Issue #23921: Standardized documentation whitespace formatting.
Show description for dba9039
serhiy-storchaka
committed
dba9039
View commit details
Copy full SHA for dba9039
View code at this point
Browse repository at this point
Commits on Apr 8, 2016
Issue #25609: Introduce contextlib.AbstractContextManager and
Show description for 9e080e0
brettcannon
committed
9e080e0
View commit details
Copy full SHA for 9e080e0
View code at this point
Browse repository at this point
Commits on Mar 31, 2016
Remove redundant leading zeroes in PEP references.
serhiy-storchaka
committed
e4ba872
View commit details
Copy full SHA for e4ba872
View code at this point
Browse repository at this point
Commits on Nov 2, 2015
Issue #25523: Merge a-to-an corrections from 3.4.
serhiy-storchaka
committed
a84f6c3
View commit details
Copy full SHA for a84f6c3
View code at this point
Browse repository at this point
Issue #25523: Further a-to-an corrections.
serhiy-storchaka
committed
d65c949
View commit details
Copy full SHA for d65c949
View code at this point
Browse repository at this point
Commits on Oct 10, 2015
Issue #25161: Merge full stops from 3.4 into 3.5
vadmium
committed
84835ab
View commit details
Copy full SHA for 84835ab
View code at this point
Browse repository at this point
Issue #25161: Add full stops in documentation; patch by Takase Arihiro
vadmium
committed
d21e0b5
View commit details
Copy full SHA for d21e0b5
View code at this point
Browse repository at this point
Commits on Nov 28, 2014
Issue #22389: Add contextlib.redirect_stderr().
berkerpeksag
committed
bb44fe0
View commit details
Copy full SHA for bb44fe0
View code at this point
Browse repository at this point
Commits on Oct 12, 2014
Issue #21061: correctly note redirect_stdout is reentrant
ncoghlan
committed
36d8ef9
View commit details
Copy full SHA for 36d8ef9
View code at this point
Browse repository at this point
Commits on Oct 10, 2014
Issue 22603: add missing 'self'. Patch by Francisco Fernández Castaño.
terryjreedy
committed
f9bd920
View commit details
Copy full SHA for f9bd920
View code at this point
Browse repository at this point
Commits on May 26, 2014
Issue 21558: Fix a typo in the contextlib docs
rhettinger
committed
e8e2df3
View commit details
Copy full SHA for e8e2df3
View code at this point
Browse repository at this point
Commits on Nov 3, 2013
Close #19403: make contextlib.redirect_stdout reentrant
ncoghlan
committed
8e113b4
View commit details
Copy full SHA for 8e113b4
View code at this point
Browse repository at this point
Commits on Oct 20, 2013
What's New updates prior to alpha
ncoghlan
committed
0acceb7
View commit details
Copy full SHA for 0acceb7
View code at this point
Browse repository at this point
Commits on Oct 19, 2013
contextlib doc updates and refactoring
Show description for 8608d26
ncoghlan
committed
8608d26
View commit details
Copy full SHA for 8608d26
View code at this point
Browse repository at this point
Previous
Next
You can’t perform that action at this time.