1
gcweb Jan 21, 2014
是否一定需要这样的数据结构才能解决问题呢?
我总觉得需要这种hack的代码,本身结构上就需要调整。。。 |
2
pohuty Jan 22, 2014 In [2]: from collections import defaultdict
In [3]: a = defaultdict(dict) In [4]: a['hell']['good']= 1 In [5]: a Out[5]: defaultdict(<type 'dict'>, {'hell': {'good': 1}}) |
5
gully Jan 24, 2014
|