]> granicus.if.org Git - python/commitdiff
Merged revisions 80150,80460-80461 via svnmerge from
authorGeorg Brandl <georg@python.org>
Sun, 25 Apr 2010 10:19:53 +0000 (10:19 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 25 Apr 2010 10:19:53 +0000 (10:19 +0000)
svn+ssh://pythondev@svn.python.org/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.
........

Doc/documenting/style.rst
Doc/howto/doanddont.rst
Doc/library/argparse.rst

index 593f6dadfeaa304f539afc8f9d703ae8bf469cd2..614555977ab90cace0dd52c55f24a94a827138ce 100644 (file)
@@ -66,5 +66,5 @@ Unix
     1970s.
 
 
-.. _Apple Publications Style Guide: http://developer.apple.com/documentation/UserExperience/Conceptual/APStyleGuide/APSG_2008.pdf
+.. _Apple Publications Style Guide: http://developer.apple.com/mac/library/documentation/UserExperience/Conceptual/APStyleGuide/APSG_2009.pdf
 
index a9302edbf65d26d63e51aa276c3ff7f429491019..071eb2a1cc1d10607b99c65fee6cab86ea6ec93c 100644 (file)
@@ -199,11 +199,8 @@ file would not be closed when an exception is raised until the handler finishes,
 and perhaps not at all in non-C implementations (e.g., Jython). ::
 
    def get_status(file):
-       fp = open(file)
-       try:
+       with open(file) as fp:
            return fp.readline()
-       finally:
-           fp.close()
 
 
 Using the Batteries
index 0515688d01b750014766a152be421329dded2744..89ab63ae9aa8673a7c3e183f6f354e24c4198463 100644 (file)
@@ -1700,7 +1700,7 @@ Upgrading optparse code
 Originally, the argparse module had attempted to maintain compatibility with
 optparse.  However, optparse was difficult to extend transparently, particularly
 with the changes required to support the new ``nargs=`` specifiers and better
-usage messges.  When most everything in optparse had either been copy-pasted
+usage messages.  When most everything in optparse had either been copy-pasted
 over or monkey-patched, it no longer seemed practical to try to maintain the
 backwards compatibility.