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
Reorder 'with' statement for files in Python Tutorial #50768
Comments
Actually, the Python Tutorial recommends the use of the 'with' statement
But the example and description are at the very bottom of this very If this suggestion is to be taken seriously, I suggest putting this |
All the examples there assume that "a file object called f has already been created". Using a 'with' there it's not a good idea because the users will have to keep the instructions indented under the 'with'. |
Good suggestion -- here's a patch that moves it and rewrites a little. |
The patch looks good to me. I think we can tweak the content a bit. I left some comments on Rietveld. Thanks! |
@akuchling Can you prepare a PR on GitHub? |
PR filed against master: #2143 |
Thanks everyone! There are a bunch of conflicts when trying to backport to 2.7, so I decided not to bother. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: