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!
名字空间就是个顶呱呱好的主意。让我们想出更多的好主意!

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 13,522评论 0 23
  • 每个月总有那么几天,不想说话不想呼吸。 想想并不光明的前途,看看道路的曲折,有时再回想到自己的人生中所有的囧事,历...
    郭大茹阅读 3,579评论 0 1
  • 这几周一直像小陀螺一样,不停地忙碌着,似乎终于过上了我自己说的那种充实的生活。可是自己并没有想象中的快乐,反而总是...
    沧海蜉蚴阅读 1,837评论 0 1
  • 1.有序列表: 有序列表同样,有序列表也是一列项目,列表项目使用数字进行标记。有序列表始于标签 。每个列表项始于 ...
    黄花菜已凉阅读 6,030评论 0 0

友情链接更多精彩内容