A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/attachments/20140222/efc3fc8c/attachment.html below:

<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 22/02/2014 16:36, Brett Cannon
      wrote:</div>
    <blockquote
cite="mid:CAP1=2W65Q0YtvzWo4PGm2qW9qaVuvX3k+WLYV853gNApv88Fbw@mail.gmail.com"
      type="cite">
      <div dir="ltr"><br>
        <div class="gmail_extra">
          <div class="gmail_quote">On Sat, Feb 22, 2014 at 4:13 AM,
            Antoine Pitrou <span dir="ltr"><<a
                moz-do-not-send="true" href="mailto:solipsis@pitrou.net"
                target="_blank">solipsis@pitrou.net</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div class="">On Fri, 21 Feb 2014 09:37:29 -0800<br>
                Guido van Rossum <<a moz-do-not-send="true"
                  href="mailto:guido@python.org">guido@python.org</a>>
                wrote:<br>
                > I'm put off by the ':' syntax myself (it looks to
                me as if someone forgot a<br>
                > newline somewhere) but 'then' feels even weirder
                (it's been hard-coded in<br>
                > my brain as meaning the first branch of an 'if').<br>
                <br>
              </div>
              Would 'else' work rather than 'then'?<br>
            </blockquote>
            <div><br>
            </div>
            <div>thing = stuff['key'] except KeyError else None</div>
            <div><br>
            </div>
            <div>That reads to me like the exception was silenced and
              only if there is no exception the None is returned, just
              like an 'else' clause on a 'try' statement.</div>
            <div><br>
            </div>
            <div>I personally don't mind the 'then' as my brain has been
              hard-coded to mean "the first branch of a statement" so
              it's looser than being explicitly associated with 'if' but
              with any multi-clause statement.</div>
          </div>
        </div>
      </div>
      <br>
    </blockquote>
    I read <b>except</b> as 'except if', and <b>:</b> as 'then'
    (often), so the main proposal reads naturally to me.  I'm surprised
    to find others don't also, as that's the (only?) pronunciation that
    makes the familiar if-else and try-except constructs approximate
    English.<br>
    <br>
    Isn't adding a new keyword (<b>then</b>) likely to be a big deal?
    There is the odd example of its use as an identifier, just in our
    test code:<br>
<a class="moz-txt-link-freetext" href="http://hg.python.org/cpython/file/0695e465affe/Lib/test/test_epoll.py#l168">http://hg.python.org/cpython/file/0695e465affe/Lib/test/test_epoll.py#l168</a><br>
<a class="moz-txt-link-freetext" href="http://hg.python.org/cpython/file/0695e465affe/Lib/test/test_xmlrpc.py#l310">http://hg.python.org/cpython/file/0695e465affe/Lib/test/test_xmlrpc.py#l310</a><br>
    <br>
    Jeff Allen<br>
  </body>
</html>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4