Hacker News new | ask | show | jobs
by echoangle 179 days ago
The value in the collection could be the actual value None, that’s different from the collection not having the key.
2 comments

    missing = object()
    data = collection.get("key", missing)
    if data is missing:
         ...
    else:
         ....
That's why I said "normally".