外观
Python之禅
在控制台执行 import this,可以看到全文:
The Zen of Python
text
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.
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!1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
对应中文译文:
Python之禅
text
Python之禅, by Tim Peters
优美优于丑陋。
明了优于隐晦。
简单优于复杂。
复杂优于凌乱。
扁平优于嵌套。
稀疏优于密集。
可读性很重要。
特例不足以打破规则。
尽管实用性胜过纯粹。
错误不应悄无声息地传递。
除非明确地沉默。
面对歧义,拒绝猜测的诱惑。
应该有一种——最好只有一种——明显的处理方式。
尽管这种方式一开始可能并不明显,除非你是荷兰人。
现在做胜过不做。
尽管不做常常胜过立马去做。
如果实现难以解释,那是个坏主意。
如果实现易于解释,那可能是个好主意。
命名空间是个绝妙的主意——让我们多做一些吧!1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21