会员

贴心博客(Imblog)

基于`Imcat(贴心猫)+(微样式)Weys`开发

PEP 20 -- The Zen of Python

2022-01-13 19:11 学习

from:
https://www.python.org/dev/peps/pep-0020/

PEP 20 -- 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!

from (henryPKU):
https://www.zhihu.com/question/264791421/answer/286385738

Python 有一个最大的特点就是对语言风格非常看重,堪称各语言之最。它的创始人 Guido van Rossum 是一个语言风格强迫症患者,他亲自操刀写的 [PEP8] Python 风格指南 就像我们的《小学生守则》一般,入门必看。另外,同样著名的还有 [PEP20] Python 之禅 ,堪称每个 Python 程序猿的八字箴言

来源:(原创) 编辑:peace 关键词:

    More 心情墙

  • 0 我吹过你吹过的风,这算不算相拥; 我走过你走过的路,这算不算相逢。 某小卫:算,都算!拉走隔离! (from某公众号留言)
  • 0 我的要求并不高… Sqlite一样好, cli命令行一样好, PyQuery一样好, …
  • 25 Win7-64bit + Python-3.7.4: Django-2.2.24 安装失败 ... Django-3.2.9 安装失败 ... Django-2.1.15 安装成功! 为啥 Django-2.2+ 安装失败?
  • 23 文学的力量:鲁迅先生,弃医学文;结果他这业余文学成就比他专业医学成就还高; 李彦宏同志,IT终于疲惫了;也拿起笔写起了书:《智能交通》…
  • 有所为,有所不为,是为华为! 凝心聚力,中华有为!

    22 2019-06-02

  • 2019愿望: 1.多健身少生病;2.学习英语,心理学;3.发布`贴心博客`,`贴心企业网`,`贴心房产网`(部分合作开发)...

    27 2018-12-31

  • 愿与[企业,客户]三方利益达到最佳平衡!

    4 2018-12-16

    More 和平鸽小语

  • 0 HI,2022!今天看到的朋友圈,如无特别忌讳,我一律点赞!
  • 33 如果觉得活得太艰难,那就考虑怎样轻松去死! (笔者此时积极生活,热爱生命;没毛病,无需进精神病医院。)
  • 236 不晒妻娃,那是家庭隐私; 不晒工作,那是商业机密。
  • 26 健康第一,X无止境,努力YY,积极ZZ !
导航
博客文章
便笺墙
家族亲友树
联系我们
地址:银河县太阳镇地球村
电话:135-37****47
邮箱:80893510@qq.com

Copyright@贴心博客(Imblog)

Run:1.819/21.243(ms); 6(sql)/2.352(MB); comm:info/detail; Upd:2022-01-21 18:46:34