您的位置:首页 > 编程语言 > Python开发

The Zen of Python

2016-04-11 00:00 555 查看
摘要: >>> import this

The Zen of Python, by Tim Peters

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.

可读性H。

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!

名称空间是一个很棒的想法——让我们做更多的!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: