mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-27 06:12:19 +01:00
list have also setters
This commit is contained in:
parent
689e480cd5
commit
ea0aff363e
2 changed files with 10 additions and 0 deletions
|
|
@ -200,6 +200,11 @@ class ListStrictEntity(ItemEntity):
|
|||
idx = int(idx)
|
||||
return self.children[idx]
|
||||
|
||||
def __setitem__(self, idx, value):
|
||||
if not isinstance(idx, int):
|
||||
idx = int(idx)
|
||||
self.children[idx].set(value)
|
||||
|
||||
def get(self, idx, default=None):
|
||||
if not isinstance(idx, int):
|
||||
idx = int(idx)
|
||||
|
|
|
|||
|
|
@ -50,6 +50,11 @@ class ListEntity(EndpointEntity):
|
|||
idx = int(idx)
|
||||
return self.children[idx]
|
||||
|
||||
def __setitem__(self, idx, value):
|
||||
if not isinstance(idx, int):
|
||||
idx = int(idx)
|
||||
self.children[idx].set(value)
|
||||
|
||||
def get(self, idx, default=None):
|
||||
if not isinstance(idx, int):
|
||||
idx = int(idx)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue