<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">On 15/09/2012 09:21, Paul Wiseman
      wrote:<br>
    </div>
    <blockquote
cite="mid:CACgdh2hCL=L4z5siVY-co0D6BXAiYycu-+gwup7q=_28=+fBew@mail.gmail.com"
      type="cite">
      <div class="gmail_quote">On 14 September 2012 02:52, Stephen J.
        Turnbull <span dir="ltr"><<a moz-do-not-send="true"
            href="mailto:stephen@xemacs.org" target="_blank">stephen@xemacs.org</a>></span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          Terry Reedy writes:<br>
          <br>
           > try:<br>
           >    try:<br>
          <br>
          Ugh-ugh.<0.5 wink><br>
          <div class="im"><br>
             > try:<br>
             >      operation()<br>
             > except Exception as err:<br>
             >      if isinstance(err, IOError) and err.errno == 2:<br>
            <br>
          </div>
          Ugh.<0.5 wink><br>
          <br>
          Not your fault, but these constructions are pretty ugly IMO, I
          have to<br>
          go with the OP on that.<br>
          <br>
          ISTR there were discussions of "qualified except" clauses here
          maybe<br>
          6mo to 1yr ago?  That is, they'd look something like<br>
          <div class="im"><br>
            try:<br>
                 operation()<br>
            except IOError as err if err.errno == 2:<br>
                 do_something()<br>
          </div>
          except Exception:<br>
          <div class="im">     logger.error("Error performing operation:
            {}".format(err.message)")<br>
                 some_clean_up()<br>
                 raise<br>
            <br>
          </div>
          Again ISTR that this got spiked for some reason, but maybe it
          will be<br>
          of use to the OP in formulating his next idea.  Sorry for the
          lack of<br>
          precise reference.<br>
        </blockquote>
        <div><br>
        </div>
        <div>I like that "qualified except". Almost goes without saying
          it's a much better idea/solution that my idea of a continue
          (which has already pointed out to be flawed- I'm not sure why
          now I thought it was always a syntax error)</div>
      </div>
    </blockquote>
    I really like this qualified except!  It's meaning is intuitively
    obvious - AND it's useful.<br>
    Rob Cliffe<br>
    <blockquote
cite="mid:CACgdh2hCL=L4z5siVY-co0D6BXAiYycu-+gwup7q=_28=+fBew@mail.gmail.com"
      type="cite">
      <div class="gmail_quote">
        <div> </div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div class="HOEnZb">
            <div class="h5">_______________________________________________<br>
              Python-ideas mailing list<br>
              <a moz-do-not-send="true"
                href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
              <a moz-do-not-send="true"
                href="http://mail.python.org/mailman/listinfo/python-ideas"
                target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Python-ideas mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Python-ideas@python.org">Python-ideas@python.org</a>
<a class="moz-txt-link-freetext" href="http://mail.python.org/mailman/listinfo/python-ideas">http://mail.python.org/mailman/listinfo/python-ideas</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>