-
Notifications
You must be signed in to change notification settings - Fork 19
[FEATURE] get_deep() method #14
Copy link
Copy link
Open
Labels
Effort: MediumHow to waste a beautiful weekendHow to waste a beautiful weekendNeeds: DocImprovements or additions to documentationImprovements or additions to documentationNeeds: TestHey, it compiles! Ship it!Hey, it compiles! Ship it!Priority: LowNot a big problem...Not a big problem...Type: EnhancementNew feature or requestNew feature or request
Description
Metadata
Metadata
Assignees
Labels
Effort: MediumHow to waste a beautiful weekendHow to waste a beautiful weekendNeeds: DocImprovements or additions to documentationImprovements or additions to documentationNeeds: TestHey, it compiles! Ship it!Hey, it compiles! Ship it!Priority: LowNot a big problem...Not a big problem...Type: EnhancementNew feature or requestNew feature or request
get_deep(*args, default=_sentinel)can accept a single argument, that must be an iterable, or multiple arguments.The first element must be a key of the
frozendict. If there's no a second element, the value is returned. If it's present, it tries to use it as argument for the eventual__getitem__()of the value object, and so on.In this process, if a
KeyError, anIndexErroror aTypeErroris raised, ifdefaultis set its value is returned, otherwise the exception will be re-raised.Example:
See also #13