mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
adde contains magic methods for dicts
This commit is contained in:
parent
9b6260665f
commit
85dc0c684b
2 changed files with 6 additions and 0 deletions
|
|
@ -29,6 +29,9 @@ class DictImmutableKeysEntity(ItemEntity):
|
|||
for key in self.keys():
|
||||
yield key
|
||||
|
||||
def __contains__(self, key):
|
||||
return key in self.non_gui_children
|
||||
|
||||
def get(self, key, default=None):
|
||||
return self.non_gui_children.get(key, default)
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@ class DictMutableKeysEntity(ItemEntity):
|
|||
for key in self.keys():
|
||||
yield key
|
||||
|
||||
def __contains__(self, key):
|
||||
return key in self.children_by_key
|
||||
|
||||
def pop(self, key, default=_miss_arg):
|
||||
if key not in self.children_by_key:
|
||||
if default is self._miss_arg:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue