Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 386bc6d

Browse files
committed
Merged revisions 80150,80460-80461 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r80150 | r.david.murray | 2010-04-17 17:45:38 +0200 (Sa, 17 Apr 2010) | 2 lines Update link to Apple Publication Style guide. ........ r80460 | georg.brandl | 2010-04-25 12:16:00 +0200 (So, 25 Apr 2010) | 1 line #8528: fix typo. ........ r80461 | georg.brandl | 2010-04-25 12:17:27 +0200 (So, 25 Apr 2010) | 1 line #8522: use with statement instead of try-finally for file handling. ........
1 parent 7f810cd commit 386bc6d

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

Doc/documenting/style.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,5 @@ Unix
6666
1970s.
6767

6868

69-
.. _Apple Publications Style Guide: http://developer.apple.com/documentation/UserExperience/Conceptual/APStyleGuide/APSG_2008.pdf
69+
.. _Apple Publications Style Guide: http://developer.apple.com/mac/library/documentation/UserExperience/Conceptual/APStyleGuide/APSG_2009.pdf
7070

Doc/howto/doanddont.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,8 @@ file would not be closed when an exception is raised until the handler finishes,
199199
and perhaps not at all in non-C implementations (e.g., Jython). ::
200200

201201
def get_status(file):
202-
fp = open(file)
203-
try:
202+
with open(file) as fp:
204203
return fp.readline()
205-
finally:
206-
fp.close()
207204

208205

209206
Using the Batteries

Doc/library/argparse.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,7 @@ Upgrading optparse code
17001700
Originally, the argparse module had attempted to maintain compatibility with
17011701
optparse. However, optparse was difficult to extend transparently, particularly
17021702
with the changes required to support the new ``nargs=`` specifiers and better
1703-
usage messges. When most everything in optparse had either been copy-pasted
1703+
usage messages. When most everything in optparse had either been copy-pasted
17041704
over or monkey-patched, it no longer seemed practical to try to maintain the
17051705
backwards compatibility.
17061706

0 commit comments

Comments
 (0)