Fixed keypath_separator inheritance when init from another benedict instance. #35

This commit is contained in:
Fabio Caccamo 2020-09-22 14:08:31 +02:00
parent 81197b2d71
commit a8ebc85105
1 changed files with 3 additions and 1 deletions

View File

@ -36,7 +36,9 @@ class benedict(KeypathDict, IODict, ParseDict):
Constructs a new instance.
"""
if len(args) == 1 and isinstance(args[0], benedict):
super(benedict, self).__init__(args[0].dict(), **kwargs)
obj = args[0]
kwargs.setdefault('keypath_separator', obj.keypath_separator)
super(benedict, self).__init__(obj.dict(), **kwargs)
return
super(benedict, self).__init__(*args, **kwargs)