The Zen of Python, by Tim Peters
Beautiful is better than ugly. 美比丑好
Explicit is better than implicit. 明確的比不明確的好
Simple is better than complex.簡(jiǎn)單比復(fù)雜好
Complex is better than complicated. ?步驟(模塊)多的比復(fù)雜(模塊少殴蹄,雜糅在一起)好
Flat is better than nested. 扁平比嵌套好(并行比串行?)
Sparse is better than dense. 稀疏生于密集(接口參數(shù)少比多好刺下,功能單一比多好)
Readability counts. 可讀性很重要
Special cases aren't special enough to break the rules. 規(guī)則(結(jié)構(gòu))內(nèi)部可以有特例
Although practicality beats purity. 實(shí)用性才是目的
Errors should never pass silently.錯(cuò)誤絕不能默默傳遞
Unless explicitly silenced. 除非你確定這個(gè)錯(cuò)誤要這樣做
In the face of ambiguity, refuse the temptation to guess.可能性較多時(shí)橘茉,不要去猜測(cè)
There should be one– and preferably only one –obvious way to do it. 有或者只有一個(gè)方法去解決
Although that way may not be obvious at first unless you're Dutch.這很不容易,因?yàn)槟悴皇莗ython之父
Now is better than never. 現(xiàn)在比以前更好(大學(xué)生看小學(xué)生的作業(yè),很容易弄懂 -__- !)
Although never is often better thanrightnow.現(xiàn)在是最好的
If the implementation is hard to explain, it's a bad idea. 如果代碼(any)實(shí)現(xiàn)很難解釋构挤,這可能并不是一個(gè)好的代碼(any)
If the implementation is easy to explain, it may be a good idea.如果代碼(any)實(shí)現(xiàn)很好解釋,這也許是一份好的代碼(any)
Namespaces are one honking great idea – let's do more of those!