Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-39037: Look up __enter__ before __exit__ in the with statement documentation #17608

Merged
merged 8 commits into from
Dec 30, 2019

Conversation

geryogam
Copy link
Contributor

@geryogam geryogam commented Dec 14, 2019

This PR will make these changes to the Compound statements chapter of the language documentation:

https://bugs.python.org/issue39037

@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting review labels Dec 14, 2019
@geryogam geryogam changed the title bpo-39037: Fix wrong trial order of __exit__ and __enter__ in the with statement bpo-39037: Fix the trial order of the __exit__ and __enter__ methods in the with statement documentation Dec 14, 2019
Doc/reference/compound_stmts.rst Outdated Show resolved Hide resolved
Doc/reference/compound_stmts.rst Outdated Show resolved Hide resolved
Doc/reference/compound_stmts.rst Outdated Show resolved Hide resolved
Doc/reference/compound_stmts.rst Show resolved Hide resolved
@brettcannon
Copy link
Member

@maggyero your PR is failing CI.

Adding @ncoghlan as a reviewer since he probably is a good judge about the accuracy of the proposed clarification.

@geryogam
Copy link
Contributor Author

@brettcannon Fixed, CI passed, thanks.

@brettcannon brettcannon requested review from 1st1 and asvetlov December 17, 2019 18:00
@miss-islington
Copy link
Contributor

Thanks @maggyero for the PR, and @ncoghlan for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-17749 is a backport of this pull request to the 3.8 branch.

miss-islington added a commit that referenced this pull request Dec 30, 2019
…ntation (GH-17608)

* __enter__ is now looked up before __exit__ to give a more intuitive error message
* add pseudo-code equivalent for the with statement
* fix pseudo-code for the async with statement to use a finally clause
* use SUITE rather than BLOCK for consistency with the language grammar

Patch by Géry Ogam.
(cherry picked from commit 226e6e7)

Co-authored-by: Géry Ogam <[email protected]>
@geryogam geryogam deleted the patch-13 branch December 30, 2019 10:54
@geryogam
Copy link
Contributor Author

Thanks @serhiy-storchaka, @brettcannon and @ncoghlan for reviewing this PR!

@geryogam geryogam changed the title bpo-39037: Fix the trial order of the __exit__ and __enter__ methods in the with statement documentation bpo-39037: Look up __enter__ before __exit__ in the with statement documentation Jan 14, 2020
shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
…ntation (pythonGH-17608)

* __enter__ is now looked up before __exit__ to give a more intuitive error message
* add pseudo-code equivalent for the with statement
* fix pseudo-code for the async with statement to use a finally clause
* use SUITE rather than BLOCK for consistency with the language grammar

Patch by Géry Ogam.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants