PEP 20 -- The Zen of Python

>>> import this
The Zen of Python, by 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.

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!

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 9,968评论 0 23
  • 首先准备工具:扇面卡纸、狼毫毛笔、勾线毛笔、小楷毛笔、墨、水、印章。 步骤: 一、狼毫毛笔侧峰画出枝干,墨色稍重,...
    Encounter时光阅读 1,123评论 17 26
  • 门庭槐树叶已落, 一夜裹上白银霜。 寒风刺骨要加裳, 原是秋去冬已至。
    黎沁阅读 106评论 0 0
  • 明亮的卫生间里,洗衣机的门打开着,我手里拿着一件要洗的夹克,心里有点紧张。如果,我把这件夹克扔进去的话,明天上午我...
    半朽阅读 549评论 29 27
  • “I love three things in this world,the sun for day,the mo...
    宏木每阅读 822评论 0 0