Unverified Commit 9e05252b authored by Yanyi Liu's avatar Yanyi Liu Committed by GitHub
Browse files

[Misc] Add __setitem__ for LazyDict (#10469)


Signed-off-by: default avatarYanyi Liu <wolfsonliu@163.com>
parent d200972e
......@@ -1491,6 +1491,9 @@ class LazyDict(Mapping, Generic[T]):
self._dict[key] = self._factory[key]()
return self._dict[key]
def __setitem__(self, key: str, value: Callable[[], T]):
self._factory[key] = value
def __iter__(self):
return iter(self._factory)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment