>>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條評論
主站蜘蛛池模板: 日本高清视频www夜色资源网 | 精品卡1卡二卡3卡 | 欧美一区二区三区在线播放 | 精品久久精品 | 国产视频在线看 | 国产精品原创av片国产免费 | 久操视频网 | 日本黄色大片免费 | 精品欧美乱码久久久久久 | 亚洲午夜av | 奇米777四色影视在线看 | 91精品久久久久久综合五月天 | 九九久久99综合一区二区 | 精品国产三级 | 精品久久久中文字幕一区 | 精品女同一区二区三区免费播放 | 亚洲a网| 妞干在线 | 黄色片免费在线 | 91福利免费观看 | 久久久久成人精品免费播放 | 免费看av的网址 | 国产亚洲福利精品一区 | 欧美色欧美色 | 久久久久久久99精品免费观看 | 亚洲色图偷拍视频 | 黄网站在线免费 | 亚洲视频在线一区 | 99精品在线免费 | 99毛片| 男女午夜 | 911网站大全在线观看 | 99热中文 | hd性videos意大利复古 | 日本欧美一区二区三区不卡视频 | 波多野结衣一区2区3区 | 免费视频二区 | 成人免费无毒在线观看网站 | 国产99久久亚洲综合精品 | a视频免费 | 干干干操操操 |