Import this—Python的設計原則
在python互動直譯器中輸入“Import this”,就會出現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!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29067253/viewspace-2072710/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 你知道Python設計模式的原則嗎?Python設計模式
- Python學習筆記之 Python設計思想&設計原則Python筆記
- 設計模式的設計原則設計模式
- 設計原則
- 設計原則:開閉原則(OCP)
- 設計原則 設計模式設計模式
- 【設計模式】設計原則設計模式
- 設計模式 - 設計原則設計模式
- Python設計模式六大原則!Python設計模式
- HBase的RowKey設計原則
- MySQL 索引的設計原則MySql索引
- SOLID 設計原則Solid
- URI設計原則
- 安全設計原則
- Hbase 設計原則
- 設計原則-依賴反轉原則
- 設計原則之【介面隔離原則】
- 設計原則:介面隔離原則(ISP)
- 軟體設計原則—介面隔離原則
- 軟體設計原則—合成複用原則
- 設計原則之【單一職責原則】
- 設計原則之【開放封閉原則】
- 設計原則之【依賴反轉原則】
- 設計原則之【裡式替換原則】
- 必知必會的設計原則——介面隔離原則
- SOLID 原則:軟體設計的基本原則Solid
- 好RESTful API的設計原則RESTAPI
- Kubernetes設計的4個原則
- C++設計模式的原則C++設計模式
- loc框架設計原則框架
- mysql 索引設計原則MySql索引
- DDD聚合設計原則
- 軟體設計原則
- 元件/框架設計原則元件框架
- 系統設計原則
- 設計原則總結
- JavaScript設計模式(一)設計原則JavaScript設計模式
- Javascript 設計模式之設計原則JavaScript設計模式
- 設計模式(06)——設計原則(1)設計模式