3 comments

  • lpghatguy7 minutes ago
    When I was writing a bunch of Lua, I was a big fan of having a None sentinel value (Lua uses &#x27;nil&#x27; for representing absence) and it was useful for a lot of things similar to Pydantic&#x27;s MISSING.<p>This distinction is something that I think is actually handy about JavaScript, and distinguishing between &#x27;null&#x27; and &#x27;undefined&#x27; is sometimes useful for similar reasons.
  • RantyDave22 minutes ago
    &quot;A simple cache returns None both for a missing key and for a key that maps to None.&quot;<p>No, it returns KeyError. Or at least it should.
    • lyorig12 minutes ago
      Perhaps the author has had their fair share of run-ins with libraries that didn&#x27;t think their API through like that. But yes, they should.
  • chowells31 minutes ago
    I like it. I can&#x27;t see how to do better while remaining compatible with Python idioms.