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

Python 增強提案 (Python Enhancement Proposals)

PEP 20 – Python 之禪

作者:
Tim Peters <tim.peters at gmail.com>
狀態:
作用中
類型:
資訊類
建立日期:
2004年8月19日
公告歷史:
2004年8月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,討論串標題為 “The Way of Python”


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

最後修改: 2025-02-01 08:55:40 GMT