<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 2/21/2014 7:57 PM, Chris Angelico
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAPTjJmrrOFEtmGr_pB-E5uBotgUxGbDqwwtQnen--ByZMY081Q@mail.gmail.com"
      type="cite">
      <pre wrap="">On Sat, Feb 22, 2014 at 12:10 PM, Glenn Linderman <a class="moz-txt-link-rfc2396E" href="mailto:v+python@g.nevcal.com"><v+python@g.nevcal.com></a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Here's a challenge: There has been a big thread about None versus (SQL)
Null. Show how an except: expression can help the DB API more easily convert
from using None to using a new Null singleton, and you'll have a winner :)
</pre>
      </blockquote>
      <pre wrap="">
Heh! I'm not entirely sure how that would work, as I've only skimmed
the DB API thread, but I understand part of it is to do with sorting.
I'm not sure how you could embed an except-expression into that
without either changing the sort function or potentially doing part of
the sort twice:

lst = sorted(stuff) except TypeError: sorted(stuff, key=keyfunc)

at which point you may as well go straight to the key= form from the start.
</pre>
    </blockquote>
    <br>
    Yes, the "challenge" was sort of tongue-in-cheek... it was the
    latest heavily opinionated thread with no conclusion... and if a
    particular feature could help arrive at a good solution I think a
    lot of people would be happy! And probably a lot would still think
    it wasn't a good solution!<br>
    <br>
    It does help acceptance of a new feature to describe and demonstrate
    a solution to a compelling problem; Stephen's recent explanation of
    LBYL and EAFP expressions helped make it more compelling to me, it
    sounded like you added some of that to the PEP, which is good. Some
    folks didn't find the PEP examples compelling, it seems.<br>
    <br>
    The sorting is a smoke-screen. The real problem is that None and
    Null are not the same thing, and so internally the DB Api should
    invent and use Null, and translate to None (optionally) at the
    interfaces, for backwards compatibility until their users can update
    their software to use Null also.<br>
    <br>
    The implementation of Null can handle the comparison/sorting
    issue... there are a fixed number of types for SQL, so it isn't that
    hard.<br>
  </body>
</html>