1. 首页 > 产业新闻 > 激光

FYI《Python之禅》

import this

The Zen of Python, by Tim PetersBeautiful 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之禅》 作者:Tim Peters美丽优于丑陋。显式优于隐式。简单优于复杂。复杂优于繁琐。扁平优于嵌套。稀疏优于密集。可读性很重要。特殊情况不足以打破规则。尽管实用性胜过纯粹性。错误绝不应默默地溜走,除非明确地忽略它们。面对模棱两可时,拒绝猜测的诱惑。应该有一种——并且最好只有一种——明显的方式来做这件事。尽管这种方式起初可能并不明显,除非你是荷兰人。现在做比永远不做更好。尽管永远不做通常比"立刻"做更好。如果实现难以解释,那就是个坏主意。如果实现容易解释,那可能是个好主意。命名空间是非常棒的主意——让我们多用一些吧!

版权声明:本文转载于今日头条,版权归作者所有,如果侵权,请联系本站编辑删除

本文采摘于网络,不代表本站立场,转载联系作者并注明出处:https://www.iotsj.com//chanye/jiguang/5990.html

联系我们

在线咨询:点击这里给我发消息

微信号:666666