>>importthisTheZenofPython,byTimP" />

欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

python之禪

系統(tǒng) 1666 0

起源

2001年秋召開第十屆International Python Conference(IPC 10,Pycon的前身),打算征集一條印在會(huì)議T恤衫上的標(biāo)語,最終他們從Python社區(qū)收到了500多條投稿。并最中篩選確認(rèn)為 import this ,他們選擇之后覺得需要實(shí)現(xiàn)它,經(jīng)過討論最中定義為了由 Tim Peter 寫的《The zen of Python》

觸發(fā)

在交互命令中輸入 import this 就會(huì)觸發(fā)。

            
              
                >>
              
              
                >
              
              
                import
              
               this
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!

            
          

譯文

            
              
                # 譯文 轉(zhuǎn)載
              
              
Beautiful 
              
                is
              
               better than ugly
              
                .
              
              
                # 優(yōu)美勝于丑陋(Python以編寫優(yōu)美的代碼為目標(biāo))
              
              

Explicit 
              
                is
              
               better than implicit
              
                .
              
              
                # 明了勝于晦澀(優(yōu)美的代碼應(yīng)當(dāng)是明了的,命名規(guī)范,風(fēng)格相似)
              
              

Simple 
              
                is
              
               better than 
              
                complex
              
              
                .
              
              
                # 簡潔勝于復(fù)雜(優(yōu)美的代碼應(yīng)當(dāng)是簡潔的,不要有復(fù)雜的內(nèi)部實(shí)現(xiàn)) 
              
              

Complex 
              
                is
              
               better than complicated
              
                .
              
              
                # 復(fù)雜勝于凌亂(如果復(fù)雜不可避免,那代碼間也不能有難懂的關(guān)系,要保持接口簡潔)
              
              

Flat 
              
                is
              
               better than nested
              
                .
              
              
                # 扁平勝于嵌套(優(yōu)美的代碼應(yīng)當(dāng)是扁平的,不能有太多的嵌套) 
              
              

Sparse 
              
                is
              
               better than dense
              
                .
              
              
                # 間隔勝于緊湊(優(yōu)美的代碼有適當(dāng)?shù)拈g隔,不要奢望一行代碼解決問題) 
              
              

Readability counts
              
                .
              
              
                # 可讀性很重要(優(yōu)美的代碼是可讀的) 
              
              

Special cases aren't special enough to 
              
                break
              
               the rules
              
                .
              
              
Although practicality beats purity
              
                .
              
              
                # 即便假借特例的實(shí)用性之名,也不可違背這些規(guī)則(這些規(guī)則至高無上) 
              
              

Errors should never 
              
                pass
              
               silently
              
                .
              
              
Unless explicitly silenced
              
                .
              
              
                # 所有錯(cuò)誤都不應(yīng)該被直接忽略,除非能夠被精確的捕獲之后。(其中一個(gè)典型的例子就是,不建議用Exception:pass來直接忽略所有異常。)
              
              

In the face of ambiguity
              
                ,
              
               refuse the temptation to guess
              
                .
              
              
                # 當(dāng)面對不明確的情況時(shí),不要嘗試去猜測 
              
              

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
              
                .
              
              
                # 雖然起初這并不那么顯而易見,因?yàn)槟悴皇?Python 之父(這里的Dutch是指Python之父Guido Van Rossum,他是荷蘭人。)
              
              

Now 
              
                is
              
               better than never
              
                .
              
              
Although never 
              
                is
              
               often better than 
              
                *
              
              right
              
                *
              
               now
              
                .
              
              
                # 現(xiàn)在行動(dòng)勝過永不開始,但是不假思索就動(dòng)手還不如不做(動(dòng)手之前要細(xì)思量)
              
              

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
              
                .
              
              
                # 如果你的實(shí)現(xiàn)很難向別人解釋,這往往不是一個(gè)好的方案;如果你的實(shí)現(xiàn)很容易向別人解釋,這可能是個(gè)好的方案。(方案測評標(biāo)準(zhǔn)) 
              
              

Namespaces are one honking great idea 
              
                -
              
              
                -
              
               let's do more of those! 

              
                # 命名空間是一種絕妙的理念,我們應(yīng)當(dāng)多加利用(倡導(dǎo)與號召)
              
            
          

更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會(huì)非常 感謝您的哦!!!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 午夜视频在线 | 夜夜爽网站| 无码日韩精品一区二区免费 | 日韩在线视频观看 | 一级特黄特黄xxx视频 | 色天天爱天天狠天天透 | 色婷婷天天综合在线 | 欧美日韩在线一区二区 | 国产午夜精品一区二区三区在线观看 | 亚洲欧美日韩综合一区久久 | 亚洲天堂视频在线观看免费 | 成人羞羞网站 | 一区二区三区四区视频 | 青娱乐极品在线 | 79thz.com| 9久久99久久久精品齐齐综合色圆 | 一区二区免费视频观看 | www.日本在线播放 | 亚洲成a人片在线看 | 免费观看黄色a一级视频播放 | 奇米影视亚洲春色 | 一区二区三区视频免费 | 久草精品视频在线观看 | 国产九九视频在线观看 | 那里可以看毛片 | 最新久久免费视频 | 美女性视频网站 | www午夜| 美女网站在线观看视频18 | 欧美专区在线 | 亚洲一区二区三区四 | 99re视频在线观看 | 欧美综合一区二区 | 欧美一级毛片免费播放器 | 久久久91精品国产一区二区三区 | 色妞色视频一区二区三区四区 | 精品一区二区三区在线观看视频 | 日韩伊人网 | 狠狠操狠狠操 | 成人黄色在线观看视频 | 久久亚洲美女久久久久 |