proper KeyError handling in of

This commit is contained in:
AF 2023-03-28 03:03:54 +00:00
parent c9f3f5ac5c
commit 226bf1b6ad

View File

@ -22,7 +22,7 @@ class AtOf(Generic[K, V]):
def of(key: K) -> V: def of(key: K) -> V:
try: try:
return bucket[key] return bucket[key]
except IndexError: except (IndexError, KeyError):
raise Implicit raise Implicit
return at, of return at, of