The Zen of Python, by Tim Peters
Beautiful is better than ugly. 美比丑好
Explicit is better than implicit. 明确的比不明确的好
Simple is better than complex.简单比复杂好
Complex is better than complicated. 步骤(模块)多的比复杂(模块少,杂糅在一起)好
Flat is better than nested. 扁平比嵌套好(并行比串行?)
Sparse is better than dense. 稀疏生于密集(接口参数少比多好,功能单一比多好)
Readability counts. 可读性很重要
Special cases aren't special enough to break the rules. 规则(结构)内部可以有特例
Although practicality beats purity. 实用性才是目的
Errors should never pass silently.错误绝不能默默传递
Unless explicitly silenced. 除非你确定这个错误要这样做
In the face of ambiguity, refuse the temptation to guess.可能性较多时,不要去猜测
There should be one– and preferably only one –obvious way to do it. 有或者只有一个方法去解决
Although that way may not be obvious at first unless you're Dutch.这很不容易,因为你不是python之父
Now is better than never. 现在比以前更好(大学生看小学生的作业,很容易弄懂 -__- !)
Although never is often better thanrightnow.现在是最好的
If the implementation is hard to explain, it's a bad idea. 如果代码(any)实现很难解释,这可能并不是一个好的代码(any)
If the implementation is easy to explain, it may be a good idea.如果代码(any)实现很好解释,这也许是一份好的代码(any)
Namespaces are one honking great idea – let's do more of those!