Comment by 0cf8612b2e1e
14 hours ago
The author’s example chose to use the syntax that returns None on missing. If they wanted clarity the standard API does raise.
cache = {“key”: “value”, “some input”: None}
cache.get(“missing_key”)
Vs
cache[“missing_key”]
There are better examples that could have been highlighted.
No comments yet
Contribute on Hacker News ↗