diff --git a/Doc/documenting/style.rst b/Doc/documenting/style.rst index 593f6dadfea..614555977ab 100644 --- a/Doc/documenting/style.rst +++ b/Doc/documenting/style.rst @@ -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 diff --git a/Doc/howto/doanddont.rst b/Doc/howto/doanddont.rst index a9302edbf65..071eb2a1cc1 100644 --- a/Doc/howto/doanddont.rst +++ b/Doc/howto/doanddont.rst @@ -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 diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 0515688d01b..89ab63ae9aa 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -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.