Added automatic benedict casting to methods that return dict instances.
This commit is contained in:
parent
60d0502466
commit
7e7541cce5
|
@ -116,6 +116,14 @@ class benedict(KeypathDict, IODict, ParseDict):
|
||||||
return self._cast(
|
return self._cast(
|
||||||
super(benedict, self).get(key, default))
|
super(benedict, self).get(key, default))
|
||||||
|
|
||||||
|
def get_dict(self, key, default=None):
|
||||||
|
return self._cast(
|
||||||
|
super(benedict, self).get_dict(key, default))
|
||||||
|
|
||||||
|
def get_list_item(self, key, index=0, default=None, separator=','):
|
||||||
|
return self._cast(
|
||||||
|
super(benedict, self).get_list_item(key, index, default, separator))
|
||||||
|
|
||||||
def groupby(self, key, by_key):
|
def groupby(self, key, by_key):
|
||||||
"""
|
"""
|
||||||
Group a list of dicts at key by the value of the given by_key and return a new dict.
|
Group a list of dicts at key by the value of the given by_key and return a new dict.
|
||||||
|
|
Loading…
Reference in New Issue