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
37k
Star
77.4k
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.6
User selector
All users
Datepicker
All time
Commit history
Commits on Jul 23, 2018
bpo-33468: Add try-finally contextlib.contextmanager example (GH-7816) (GH-8426)
Show description for 5b3643d
2 people
authored and
taleinat
committed
5b3643d
View commit details
Copy full SHA for 5b3643d
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
Commits on Oct 17, 2013
Close #19266: contextlib.ignore -> contextlib.suppress
Show description for 240f86d
ncoghlan
committed
240f86d
View commit details
Copy full SHA for 240f86d
View code at this point
Browse repository at this point
Commits on Oct 13, 2013
Fix spacing of toplevel items.
birkenfeld
committed
a7c17e5
View commit details
Copy full SHA for a7c17e5
View code at this point
Browse repository at this point
Docs tweaks for contextlib additions
ncoghlan
committed
b4534ae
View commit details
Copy full SHA for b4534ae
View code at this point
Browse repository at this point
Commits on Oct 11, 2013
Rename contextlib.ignored() to contextlib.ignore().
rhettinger
committed
1254b40
View commit details
Copy full SHA for 1254b40
View code at this point
Browse repository at this point
Commits on Oct 10, 2013
Issue #15805: Add contextlib.redirect_stdout()
rhettinger
committed
088cbf2
View commit details
Copy full SHA for 088cbf2
View code at this point
Browse repository at this point
Commits on May 10, 2013
Merge 3.3
warsaw
committed
8c01ffa
View commit details
Copy full SHA for 8c01ffa
View code at this point
Browse repository at this point
I was confused before. It's correct to not call .close() inside the with
Show description for d8f870d
warsaw
committed
d8f870d
View commit details
Copy full SHA for d8f870d
View code at this point
Browse repository at this point
Commits on Apr 19, 2013
Merge 3.3
warsaw
committed
24aa159
View commit details
Copy full SHA for 24aa159
View code at this point
Browse repository at this point
Minor typo in example.
warsaw
committed
0aa685a
View commit details
Copy full SHA for 0aa685a
View code at this point
Browse repository at this point
Commits on Apr 1, 2013
Issue #17586: fix typo in contextlib.rst
ned-deily
committed
05bdd85
View commit details
Copy full SHA for 05bdd85
View code at this point
Browse repository at this point
Commits on Mar 11, 2013
#17351: merge with 3.3.
ezio-melotti
committed
a41fb4b
View commit details
Copy full SHA for a41fb4b
View code at this point
Browse repository at this point
#17351: merge with 3.2.
ezio-melotti
committed
c9cfcf1
View commit details
Copy full SHA for c9cfcf1
View code at this point
Browse repository at this point
Issue #15806: Add contextlib.ignored().
rhettinger
committed
e318a88
View commit details
Copy full SHA for e318a88
View code at this point
Browse repository at this point
Commits on Dec 18, 2012
Issue #16714: use 'raise' exceptions, don't 'throw'.
Show description for 5b89840
asvetlov
committed
5b89840
View commit details
Copy full SHA for 5b89840
View code at this point
Browse repository at this point
Commits on May 31, 2012
Typo fix
ncoghlan
committed
b7a455f
View commit details
Copy full SHA for b7a455f
View code at this point
Browse repository at this point
Additional ExitStack examples, and a few other cleanups for the ExitStack docs
ncoghlan
committed
2722827
View commit details
Copy full SHA for 2722827
View code at this point
Browse repository at this point
Commits on May 22, 2012
Fix the versionadded tags for a couple of my recent changes
ncoghlan
committed
a497b44
View commit details
Copy full SHA for a497b44
View code at this point
Browse repository at this point
Previous
Next
You can’t perform that action at this time.