- 參悟Python之禅 - 源起 import this
- 覓蹤
- Python之禅
參悟Python之禅 - 源起 import this
覓蹤
伴随
import this
出現
![](https://img.laitimes.com/img/_0nNw4CM6IyYiwiM6ICdiwiIwczLcVmds92czlGZvwVP9EUTDZ0aRJkSwk0LcxGbpZ2LcBDM08CXlpXazRnbvZ2LcRlMMVDT2EWNvwFdu9mZvwVPBRVT1ElaONTQU10dVNDTwYVbiVHNHpleO1GTulzRilWO5x0LcRHelR3LcJzLctmch1mclRXY39zM4MTMzcTN0ETMyMDM4EDMy8CX0Vmbu4GZzNmLn9Gbi1yZtl2Lc9CX6MHc0RHaiojIsJye.jpg)
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 way 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!
命名空間是個絕妙的想法,讓我們多多地使用它們吧!
版權聲明:轉載必須注明本文轉自 East196 的部落格:http://blog.csdn.net/east196