>>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條評論
主站蜘蛛池模板: 色之综合天天综合色天天棕色 | 久久这里只有精品23 | 日本一区二区不卡 | 高清一区高清二区视频 | 久久伊人亚洲 | 九色视频网站 | 新神奇四侠免费完整版在线观看 | 日本高清视频在线三级 | 奇米 影音先锋 | 国产二区在线播放 | 亚洲精品久久久一区二区三区 | 国产精品久久久久久影视 | 久久91综合国产91久久精品 | 久免费视频 | 三片在线观看 | 欧美在线视频一区二区 | 日韩欧美一区二区三区四区 | 欧美亚洲另类视频 | 久久久久久免费一区二区三区 | 久久3| 欧美精品九九99久久在观看 | 日韩欧美在线视频 | 久久涩涩 | 99久久国产综合精品网成人影院 | 久久久久久久国产精品影院 | 三级av免费| 天天干免费视频 | 成人免费激情视频 | 精品国产成a人在线观看 | 人人狠狠综合久久亚洲 | 免费特黄一级欧美大片在线看 | 性福演算法 | 久久精品亚洲成在人线av网址 | 免费精品美女久久久久久久久久 | 天天干网址| 亚洲精品一区在线观看 | 亚洲网站在线观看 | 久久综合九色综合欧美9v777 | 99久久精约久久久久久清纯 | 成人免费一区二区三区视频网站 | 亚洲天堂网2018 |