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 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!
命名空間是個絕妙的主意,我們要多多利用它