Skip to content

Commit 32d8d71

Browse files
committed
Forward __getitem__ directly
All other methods are just forwarding operations to the underlying `dict`, so there is no point in handling `KeyError`s manually in this method. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 3ac8377 commit 32d8d71

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/frequenz/channels/experimental/_grouping_latest_value_cache.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,7 @@ def __getitem__(self, key: HashableT) -> ValueT_co:
173173
174174
Returns:
175175
The latest value that has been received for that key.
176-
177-
Raises:
178-
KeyError: If no value has been received yet for that key.
179176
"""
180-
if key not in self._latest_value_by_key:
181-
raise KeyError(f"No value received for key: {key!r}")
182177
return self._latest_value_by_key[key]
183178

184179
@override

0 commit comments

Comments
 (0)