python zen_Python的宗旨(Zen of Python)

我们在Python中导入this模块,会打印出一段字符串:

import this

翻译对照如下:

The Zen of Python, by Tim Peters

Python的宗旨,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.

尽管一开始那条路可能不是那样明显,除非你是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!

命名空间是一个伟大的注意--我们应该好好利用

翻译过来,诗的韵味还是下降了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值