Skip to content

Commit

Permalink
Since most dig.dig() calls are just dig.subattr() anyway...
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob414 committed Dec 10, 2020
1 parent f1e5233 commit f3a6b0c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kingston/dig.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,10 @@ def dig(obj: Any, path: str) -> Any:
:param path: String representation of the *”path”*
"""

try:
# Most dig operations are simply subattr()
return subattr(obj, path)
except AttributeError:
pass

return idig(obj, lang.detect_numbers(path.split('.')))

0 comments on commit f3a6b0c

Please sign in to comment.