From 0368bfe87c99c7508b136ad9cb792f25285a2bfb Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 10 Mar 2020 21:04:49 -0700 Subject: [PATCH] Fix DotDict instantiation when calling DD(some_dict). --- voussoirkit/dotdict.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/voussoirkit/dotdict.py b/voussoirkit/dotdict.py index 072b755..b1167b5 100644 --- a/voussoirkit/dotdict.py +++ b/voussoirkit/dotdict.py @@ -8,8 +8,10 @@ from voussoirkit import sentinel NO_DEFAULT = sentinel.Sentinel('NO_DEFAULT') class DotDict: - def __init__(self, default=NO_DEFAULT, **kwargs): + def __init__(self, __dict=None, *, default=NO_DEFAULT, **kwargs): self.__default = default + if __dict: + self.__dict__.update(__dict) self.__dict__.update(**kwargs) def __getattr__(self, key):