Following system colour scheme - Python 增强提案 Selected dark colour scheme - Python 增强提案 Selected light colour scheme - Python 增强提案

Python 增强提案

PEP 20 – Python 之禅

作者:
Tim Peters <tim.peters at gmail.com>
状态:
活跃
类型:
信息性
创建日期:
2004-08-19
历史记录:
2004-08-22

目录

摘要

资深 Python 开发者 Tim Peters 简明扼要地将 BDFL 针对 Python 设计的指导原则浓缩成 20 条箴言,其中只有 19 条被记录下来。

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!

彩蛋

>>> import this

参考资料

最初发布在 comp.lang.python/python-list@python.org 的名为 “Python 之道” 的主题中。


来源: https://github.com/python/peps/blob/main/peps/pep-0020.rst

最后修改: 2023-09-09 17:39:29 GMT