Python@TW: 會眾| IRC| Planet| 郵件列表| 聯絡我們
修訂版 41 和 42 的差異如下:
2007-03-01 00:58:02 修訂第 41 版
大小: 4541
編輯者: gasolin
說明: http://inet6.blogspot.com/2006/10/python.html
2007-04-05 23:09:42 修訂第 42 版
大小: 6291
編輯者: yungyuc
說明:
這個顏色代表刪除的 這個顏色代表增加的
行號 1: 行號 1:
 . [http://www.python.org/dev/peps/pep-0020/ PEP 20 ] The Zen of Python, by Tim Peters ([:PotPeople:POT眾]集體翻譯) -- 一人認領一句吧 :)
每一句都有一個翻譯版了,但請繼續精進。如果你覺得合適,把改過的部分補進#整合版。
Tim Peters 所提出的 PEP 20 "[http://www.python.org/dev/peps/pep-0020/ The Zen of Python]" 是撰寫 Python 程式的精神指標。別懷疑,也別覺得太玄,每一句都是金玉良言。

= The Zen of Python (英文原文版) =

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!

= Python 精神 (POT 眾譯版) =

美優於醜,顯明好過隱晦。

簡潔者為上,複雜者次之,繁澀者為下。

平舖善於層疊,勻散勝過稠密:應使村婦可讀。

特例難免但不可打破原則,務求純淨卻不可不切實際。

斷勿使錯誤靜靜流逝,除非有意如此。

在模擬兩可之間,拒絕猜測的誘惑。

總會有一種明確的寫法,最好也只有一種,

但或須細想方可得。

現在開始,強過不作,然而不處理常比*馬上*處理更好。

不易解釋的實作方式,就不是好主意。

容易解釋的實作方法,說不定是好主意。

命名空間是個頂呱呱的點子 -- 這種點子愈多愈好!

= POT 眾集思區 =

每一句都有一個翻譯版了,但請繼續精進。如果你覺得合適,把改過的部分補進下面的整合版。
行號 66: 行號 135:
= 整合版 = == 整合版 ==

Tim Peters 所提出的 PEP 20 "[http://www.python.org/dev/peps/pep-0020/ The Zen of Python]" 是撰寫 Python 程式的精神指標。別懷疑,也別覺得太玄,每一句都是金玉良言。

The Zen of Python (英文原文版)

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!

Python 精神 (POT 眾譯版)

美優於醜,顯明好過隱晦。

簡潔者為上,複雜者次之,繁澀者為下。

平舖善於層疊,勻散勝過稠密:應使村婦可讀。

特例難免但不可打破原則,務求純淨卻不可不切實際。

斷勿使錯誤靜靜流逝,除非有意如此。

在模擬兩可之間,拒絕猜測的誘惑。

總會有一種明確的寫法,最好也只有一種,

但或須細想方可得。

現在開始,強過不作,然而不處理常比*馬上*處理更好。

不易解釋的實作方式,就不是好主意。

容易解釋的實作方法,說不定是好主意。

命名空間是個頂呱呱的點子 -- 這種點子愈多愈好!

POT 眾集思區

每一句都有一個翻譯版了,但請繼續精進。如果你覺得合適,把改過的部分補進下面的整合版。

  • Beautiful is better than ugly.
    • 美優於醜。 -- ["timchen119"]
    • 美觀的比醜陋的好 -- ["gasolin"]
  • Explicit is better than implicit.
    • 顯明好過隱晦。 -- ["yungyuc"]
    • 直率的比含糊的好 -- ["gasolin"]
  • Simple is better than complex.
    • 簡為上,繁複次之。 -- ["Thinker"]
    • 簡單的比繁雜的好 -- ["gasolin"]
  • Complex is better than complicated.
    • 晦澀為下。 -- ["Thinker"]
    • 繁雜的比晦澀的好 -- ["gasolin"]
  • Flat is better than nested.
    • 平順善於巢雜, -- ["keitheis"]
    • 平直的比巢雜的好 -- ["gasolin"]
  • Sparse is better than dense.
    • 寧可多寫幾行程式,不要省程式省到難懂。 -- ["yungyuc"]
    • [:The Zen Of Python/Sparse is better than dense:寧散不為短巧], -- ["Thinker"]
    • 疏落有致的比櫛次鱗比的好 -- ["gasolin"]
  • Readability counts.
    • 善兮,村姑可讀。 -- ["Thinker"]
    • 村婦可讀。 -- ["Thinker"] (應該同上句一起翻譯)
    • 可讀性應當被重視 -- ["gasolin"]
  • Special cases aren't special enough to break the rules.
    • 特例並不值得我們打破原則。 -- ["yungyuc"]
    • 就算是特例, 也不能壞了規矩 -- ["gasolin"]
  • Although practicality beats purity.
    • 雖然,理想終究不敵現實。 -- ["Thinker"]
    • 然而能解決問題仍然比維持單純重要 -- ["gasolin"]
  • Errors should never pass silently.
    • 千萬別讓錯誤靜靜的過去。-- ["alingo"]
    • 不靜靜的放過任何錯誤,
    • 錯誤不應該被默默地放過 -- ["gasolin"]
  • Unless explicitly silenced.
    • 除非是個顯而易見需要安靜對待的。-- ["alingo"]
    • 除非你是故意的。
    • 除非你是刻意為之 -- ["gasolin"]
  • In the face of ambiguity, refuse the temptation to guess.
    • 隱者,晦者。不臆,不筮。 -- ["Thinker"]
    • 面對模稜兩可的情況, 要抗拒猜測的誘惑 -- ["gasolin"]
  • There should be one-- and preferably only one --obvious way to do it.
    • 事情要有一種明顯的作法,最好也只有一種, -- ["yungyuc"]
    • 應該會有一個--而且最好只有一個--最適當的方式來實現 -- ["gasolin"]
  • Although that way may not be obvious at first unless you're Dutch.
    • 雖然不是荷蘭人的你,一開始可能看不出來。 -- ["yungyuc"] (Dutch 是指 GvR 嗎? -- ["yungyuc"])
    • 雖然不是這個語言創造者的妳一開始可能看不出來 -- ["gasolin"]
  • Now is better than never.
    • 現在開始,強過不作, -- ["yungyuc"]
    • 現在動手比總是不動手的好 -- ["gasolin"]
  • Although never is often better than *right* now.
    • 雖然有時候不處理比*馬上*處理更好。 -- ["yungyuc"] (這兩句怪怪的? -- ["yungyuc"])
    • 然而不動手可能還比沒有準備就動手的好 -- ["gasolin"]
  • If the implementation is hard to explain, it's a bad idea.
    • 不易解釋的實作方式,就不是好主意。 -- ["yungyuc"]
    • 如果實作方式難以解釋, 那大概是個壞主意 -- ["gasolin"]
  • If the implementation is easy to explain, it may be a good idea.
    • 容易解釋的實作方法,說不定是好主意。 -- ["yungyuc"]
    • 如果實作方式易於解釋, 那可能是個好主意 -- ["gasolin"]
  • Namespaces are one honking great idea -- let's do more of those!
    • 命名空間是個頂呱呱的點子 -- 儘量用! -- ["yungyuc"]
    • 名稱空間是一個很棒的主意 -- 我們就盡量用吧! -- ["gasolin"]

整合版

美優於醜,

顯明好過隱晦。

簡為上,繁複次之。

晦澀為下。

平順善於巢雜,

寧散不為短巧,

村婦可讀。

特例並不值得我們打破原則。

雖然,理想終究不敵現實。

不靜靜的放過任何錯誤,

除非你是故意的。

隱者,晦者。不臆,不筮。

事情要有一種明顯的作法,最好也只有一種,

雖然不是荷蘭人的你,一開始可能看不出來。

現在開始,強過不作,

雖然有時候不處理比*馬上*處理更好。

不易解釋的實作方式,就不是好主意。

容易解釋的實作方法,說不定是好主意。

命名空間是個頂呱呱的點子 -- 儘量用!

The Zen Of Python (上次是 ZoomQuiet 在 2010-04-08 09:57:40 編輯的)