跳至主要內容

The Zen of Python

Someone大约 1 分钟OthersPythonpython

Zon of Python By Tim Peters

translated by weigao chen

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!

命名空间,于嗟益兮!