Zen of Python(Python編程 之禪)
All the principles are listed? below:
Beautiful is better than ugly.
優(yōu)美勝于丑陋
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.
特例也不要特殊到打破這些規(guī)則
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!
命名空間很好,應該多加使用
Reference link :
Zen of Python - Wikipedia
python之禪源代碼_python之禪 - 百度文庫 (baidu.com)
(It seems BiliBili does not support the link outside)