<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#330033">
    <div class="moz-cite-prefix">On 10/17/2013 9:06 AM, Barry Warsaw
      wrote:<br>
    </div>
    <blockquote cite="mid:20131017120620.70dfa755@anarchist" type="cite">
      <pre wrap="">There's a fundamental conceptual shift here that's worth exploring more, and
which I think was first identified by RDM.

Until now, context managers were at their heart (at least IMHO) about managing
"resources".  A general resource might be an open file, or it might be a
database transaction, or even the current working directory.  Context managers
(as expressed elegantly by the `with` statement) are used to ensure that a
resource acquired for some limited operation is - to Python's best ability -
"released" at the end of that operation, no matter what happens.  E.g. the
file is closed even if there's a write error, or the current working directory
is restored to its original location.</pre>
    </blockquote>
    <br>
    The conceptual shift exists, as you two have pointed out. But that
    is mostly because Structured programming and OO have created
    sufficient conceptual idioms that people have forgotten that all of
    these idioms are to avoid bare gotos. The real purpose of all such
    constructs is to manage the instruction pointer, and context
    managers, while useful for managing "resources" in the abstract, are
    truly about managing the control flow -- hopefully in understandable
    ways.<br>
  </body>
</html>