mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-17 05:54:59 +02:00
Allow using a non-toal dict to init Options objects
This commit is contained in:
5
kittens/diff/options/types.py
generated
5
kittens/diff/options/types.py
generated
@@ -72,8 +72,11 @@ class Options:
|
||||
|
||||
def __init__(self, options_dict: typing.Optional[typing.Dict[str, typing.Any]] = None) -> None:
|
||||
if options_dict is not None:
|
||||
null = object()
|
||||
for key in option_names:
|
||||
setattr(self, key, options_dict[key])
|
||||
val = options_dict.get(key, null)
|
||||
if val is not null:
|
||||
setattr(self, key, val)
|
||||
|
||||
@property
|
||||
def _fields(self) -> typing.Tuple[str, ...]:
|
||||
|
||||
Reference in New Issue
Block a user