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”)
cache[“missing_key”]