stash: implement __len__
Part of the MutableMapping abc (though we can't actually implement that).
This commit is contained in:
@@ -123,3 +123,7 @@ class Stash:
|
||||
def __contains__(self, key: StashKey[T]) -> bool:
|
||||
"""Return whether key was set."""
|
||||
return key in self._storage
|
||||
|
||||
def __len__(self) -> int:
|
||||
"""Return how many items exist in the stash."""
|
||||
return len(self._storage)
|
||||
|
||||
Reference in New Issue
Block a user