Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-66944: Note that thecontextlib.closing example is for illustration purposes#112198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
contextlib.closing withurlopencontextlib.closing example is for illustration purposesThanks@scop for the PR, and@AA-Turner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
…ustrative purposes (pythonGH-112198)(cherry picked from commit9af9ac1)Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
…ustrative purposes (pythonGH-112198)(cherry picked from commit9af9ac1)Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
GH-114458 is a backport of this pull request to the3.12 branch. |
GH-114459 is a backport of this pull request to the3.11 branch. |
danielhollas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Late to the party but spotted a typo...
| ..note:: | ||
| Most types managing resources support the:term:`context manager` protocol, | ||
| which closes *thing* on leaving the:keyword:`with` statment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
| which closes *thing* on leaving the:keyword:`with`statment. | |
| which closes *thing* on leaving the:keyword:`with`statement. |
AA-Turner commentedJan 23, 2024
Thanks Daniel, would you want to open a PR? You can add me as a reviewer. A |
…ustrative purposes (python#112198)Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
…ustrative purposes (python#112198)Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Uh oh!
There was an error while loading.Please reload this page.
Just stumbled upon the
urlopenexample incontextlib.closingdocs and later found#66944 open for it, here's a quick crack at at least documenting the unnecessity these days.📚 Documentation preview 📚:https://cpython-previews--112198.org.readthedocs.build/