12 points | by sebg 2 days ago ago
2 comments
"A simple cache returns None both for a missing key and for a key that maps to None."
No, it returns KeyError. Or at least it should.
I like it. I can't see how to do better while remaining compatible with Python idioms.
"A simple cache returns None both for a missing key and for a key that maps to None."
No, it returns KeyError. Or at least it should.
I like it. I can't see how to do better while remaining compatible with Python idioms.