logoalt Hacker News

echoangleyesterday at 1:11 PM2 repliesview on HN

The value in the collection could be the actual value None, that’s different from the collection not having the key.


Replies

eesmithyesterday at 1:55 PM

    missing = object()
    data = collection.get("key", missing)
    if data is missing:
         ...
    else:
         ....
IshKebabyesterday at 2:39 PM

That's why I said "normally".