The zen of Python

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.
当存在多种可能时,不要尝试去猜测。 尽量找一种并且最好是唯一一种明显的解决方案(寻找唯一解决之道)。

Now is better than never. Although never is often better than right now.
做也许好过不做,但不假思索就动手去做还不如不做。

If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea.
如果你的方案很难解释,它肯定不是一个好方案;如果你的方案很容易解释,它可能是一个好方案。

Namespaces are one honking great idea -- let's do more of those!
命名空间是一种绝妙的理念,我们应当多加利用。

你可能感兴趣的:(The zen of Python)