refactor to single-line conditional assignments

This commit is contained in:
Jan Petykiewicz 2024-07-28 20:16:59 -07:00
commit 99e55f931c
2 changed files with 2 additions and 8 deletions

View file

@ -1038,10 +1038,7 @@ class Library(ILibrary):
if key in self.mapping:
raise LibraryError(f'"{key}" already exists in the library. Overwriting is not allowed!')
if callable(value):
value = value()
else:
value = value
value = value() if callable(value) else value
self.mapping[key] = value
def __delitem__(self, key: str) -> None: