diff options
Diffstat (limited to 'tools/cru-py/cru/list.py')
-rw-r--r-- | tools/cru-py/cru/list.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/cru-py/cru/list.py b/tools/cru-py/cru/list.py index c65c793..53c3c77 100644 --- a/tools/cru-py/cru/list.py +++ b/tools/cru-py/cru/list.py @@ -93,6 +93,10 @@ class CruUniqueKeyList(Generic[_T, _K]): raise KeyError(f"Key {key} not found!") return value # type: ignore + @property + def keys(self) -> Iterable[_K]: + return self._list.as_cru_iterator().map(self._key_getter) + def has_key(self, key: _K) -> bool: return self.get_or(key) != CruNotFound.VALUE |