Fixed casting to benedict to all dicts returned by any public method on Python 2.7.

This commit is contained in:
Fabio Caccamo 2019-06-10 17:18:06 +02:00
parent 16a1f6efec
commit f8b19017ce
1 changed files with 5 additions and 5 deletions

View File

@ -14,13 +14,13 @@ class benedict(KeypathDict, ParseDict):
def __getattribute__(self, name):
attr = super(benedict, self).__getattribute__(name)
if hasattr(attr, '__call__'):
if name.startswith('_'):
return attr
elif hasattr(attr, '__call__'):
# print(attr, name)
def attr_wrapper(*args, **kwargs):
value = attr(*args, **kwargs)
if name.startswith('_'):
return value
else:
return benedict._cast(value)
return benedict._cast(value)
return attr_wrapper
else:
return attr