Last active
August 29, 2015 14:06
-
-
Save axiaoxin/5ac3ddf0207c0543f7ea to your computer and use it in GitHub Desktop.
__parse_dict_depth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def __parse_dict_depth(self, d, depth=0): | |
if not isinstance(d, dict) or not d: | |
return depth | |
return max(self.__parse_dict_depth(v, depth+1) for k, v in d.iteritems()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment