在python终端输入import this
,将会显示python的语言哲学
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
| In [1]: import this
The Zen of Python, by Tim Peters
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 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!
命名空间很了不起,可以多借鉴
|