python哲学翻译_Python
正在學(xué)習(xí)Python開(kāi)發(fā)語(yǔ)言的用戶,可能會(huì)在學(xué)習(xí)過(guò)程中聽(tīng)說(shuō)過(guò)講師說(shuō)過(guò)Python有一段有關(guān)于Python的哲學(xué)理念機(jī)設(shè)計(jì)思想,在Python里輸入“import this”命令就會(huì)出現(xiàn)一段英文格言,這里我們把Python的這段格言的雙語(yǔ)版分享出來(lái),幫助正在學(xué)習(xí)Python的用戶更加深入的了解Python的精髓。
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
美麗優(yōu)于丑陋;
Explicit is better than implicit.
清楚優(yōu)于含糊;
Simple is better than complex.
簡(jiǎn)單優(yōu)于復(fù)雜;
Complex is better than complicated.
復(fù)雜優(yōu)于繁瑣;
Flat is better than nested.
平坦優(yōu)于曲折;
Sparse is better than dense.
寬松優(yōu)于密集;
Readability counts.
重要的是可讀性;
Special cases aren’t special enough to break the rules.
特殊的案例不足以特殊到破壞規(guī)則;
Although practicality beats purity.
盡管實(shí)踐可以打破真理;
Errors should never pass silently.
錯(cuò)誤卻不可置之不理;
Unless explicitly silenced.
除非另有明確要求;
In the face of ambiguity, refuse the temptation to guess.
面對(duì)模棱兩可,拒絕猜測(cè);
There should be one– and preferably only one –obvious way to do it.
總會(huì)有一個(gè) —— 最好是只有一個(gè) —— 顯而易見(jiàn)的方式來(lái)明辨;
Although that way may not be obvious at first unless you’re Dutch.
哪怕這種方式在開(kāi)始的時(shí)候可能并不明顯 —— 除非你是荷蘭人;
Now is better than never.
現(xiàn)在有比沒(méi)有好;
Although never is often better than *right* now.
盡管沒(méi)有經(jīng)常好于現(xiàn)在;
If the implementation is hard to explain, it’s a bad idea.
如果如何實(shí)現(xiàn)很難被解釋清楚,那么這個(gè)想法就是一個(gè)壞想法;
If the implementation is easy to explain, it may be a good idea.
如果如何實(shí)現(xiàn)可以被很好的解釋,那么這是一個(gè)好想法;
Namespaces are one honking great idea — let’s do more of those!
命名空間就是一個(gè)非常好的想法 —— 讓我們?cè)谶@方面多做些工作吧!
總結(jié)
以上是生活随笔為你收集整理的python哲学翻译_Python的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 北京环球影城有存包处嘛
- 下一篇: python大作业外星人入侵_【pyth