我一直在查阅Python文档,以了解大型列表和字典的代码格式最佳实践,例如
something = {'foo' : 'bar', 'foo2' : 'bar2', 'foo3' : 'bar3'..... 200 chars wide, etc..}
或者
something = {'foo' : 'bar',
'foo2' : 'bar2',
'foo3' : 'bar3',
...
}
或者
something = {
'foo' : 'bar',
'foo2' : 'bar2',
'foo3' : 'bar3',
...
}
如何处理列表/词典的深度嵌套?
我更喜欢的方式是:
我更喜欢aaronasterling的压痕样式。在another SO Question中解释了这个和其他几种样式。尤其是雷吉布罗的回答给出了一个很好的概述。
但这种风格是最受欢迎的:
相关问题 更多 >
编程相关推荐