最接近的等效项可能类似于以下内容:
import collectionsdef hasher(): return collections.defaultdict(hasher)hash = hasher()hash['element1']['sub1']['subsub1'] = 'value1'if 'subsub1' in hash['element1']['sub1']: print 'found value'

最接近的等效项可能类似于以下内容:
import collectionsdef hasher(): return collections.defaultdict(hasher)hash = hasher()hash['element1']['sub1']['subsub1'] = 'value1'if 'subsub1' in hash['element1']['sub1']: print 'found value'