Python之禅及释义

更新时间:2023-06-22 03:00:01 阅读: 评论:0

Python之禅及释义在python shell中敲 import this会触发⼀个彩蛋,神奇的打印下⾯⼀段话:
The Zen of Python, 即python之禅, 1999年Tim Peters⼤⽜总结的“武功⼼法”:放荡不羁意思
1 >>> import this
2 The Zen of Python, by Tim Peters
3
4 Beautiful is better than ugly.
5 Explicit is better than implicit.
罗曼罗兰名言6 Simple is better than complex.
7 Complex is better than complicated.
8 Flat is better than nested.
9 Spar is better than den.
金沙玉米
10 Readability counts.
11 Special cas aren't special enough to break the rules.
12 Although practicality beats purity.
13 Errors should never pass silently.
14 Unless explicitly silenced.
15 In the face of ambiguity, refu the temptation to guess.
16 There should be one-- and preferably only one --obvious way to do it.
17 Although that way may not be obvious at first unless you're Dutch.王振海
18 Now is better than never.
19 Although never is often better than *right* now.
20 If the implementation is hard to explain, it's a bad idea.
21 If the implementation is easy to explain, it may be a good idea.
22 Namespaces are one honking great idea -- let's do more of tho!
我在⽹上参考了别⼈的翻译,再结合我⾃⼰的理解翻译如下:
1 >>> import this
2 The Zen of Python, by Tim Peters
3#Python之禅, by Tim Perters
4
5 Beautiful is better than ugly.
6#优美胜于丑陋
7 Explicit is better than implicit.
8#明了胜于晦涩
9 Simple is better than complex.
10#简洁胜于复杂
11 Complex is better than complicated.
12#复杂胜于凌乱
13 Flat is better than nested.
14#扁平胜于嵌套
15 Spar is better than den.
16#稀松胜于稠密
17 Readability counts.
18#可读性很重要下班
19 Special cas aren't special enough to break the rules.
20 Although practicality beats purity.
21#实⽤虽胜于纯粹
22#但特例不⾜以改变原则(更多的时候特例并不是真的特例,⽽是你没发现更好的⽅案)23 Errors should never pass silently.
24#例外必须处理
25 Unless explicitly silenced.
中国十大名医26#除⾮这正是你期望的
文化素质27 In the face of ambiguity, refu the temptation to guess.
28#当存在多种可能性,不要尝试去猜测
29 There should be one-- and preferably only one --obvious way to do it.
30#⽽是尽量找⼀种,最好是唯⼀的⼀种,明确的⽅案
31 Although that way may not be obvious at first unless you're Dutch.
32#虽然这不太容易,除⾮你是Python之⽗
33 Now is better than never.
34#做好过不做
35 Although never is often better than *right* now.
36#但不加思索的做,有时还不如不做
土豆蒸排骨
37 If the implementation is hard to explain, it's a bad idea.
38#难以描述的⽅案,⼀定是个坏⽅案
39 If the implementation is easy to explain, it may be a good idea.
40#易于描述的⽅案,可能是个好⽅案
41 Namespaces are one honking great idea -- let's do more of tho!
42#命名空间是绝妙的理念,我们应当多加利⽤

本文发布于:2023-06-22 03:00:01,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1049221.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:翻译   彩蛋   特例   尝试
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图