mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 22:02:15 +01:00
simplified pop method
This commit is contained in:
parent
2302e158a4
commit
12e6694f1e
1 changed files with 2 additions and 7 deletions
|
|
@ -30,13 +30,8 @@ class DictMutableKeysEntity(ItemEntity):
|
|||
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:
|
||||
raise KeyError("Key \"{}\" not found.".format(key))
|
||||
return default
|
||||
|
||||
result = self.children_by_key.pop(key)
|
||||
def pop(self, key, *args, **kwargs):
|
||||
result = self.children_by_key.pop(key, *args, **kwargs)
|
||||
self.on_change()
|
||||
return result
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue