A bit briefer would be to do a `to_ack = self.internal_cache.pop(crash_id)` here. Then you don't need the separate line for the `del`. The `if/else` bit can turn into a `try/except KeyError`.