- The Python Apprentice
- Robert Smallshire Austin Bingham
- 119字
- 2021-07-02 22:16:56
Moment of zen
The text in the following image Moment of zen: Practicality beats purity – Beautiful text strings, Rendered in literal form. Simple elegance:

Figure 2.1: Moment of zen: Practicality beats purity Moment of zen
At first sight support for both quoting styles seems to violate an important principle of Pythonic style. From the Zen of Python:
There should be one – and preferably only one – obvious way to do it.
In this case, however, another aphorism from the same source takes precedence:
Practicality beats purity
The utility of supporting two quoting styles is valued more highly than the alternative:a single quoting style combined with more frequent use of ugly escape sequences, which we'll encounter shortly.
推薦閱讀
- Getting Started with Citrix XenApp? 7.6
- LabVIEW 2018 虛擬儀器程序設計
- 深入淺出Electron:原理、工程與實踐
- C和C++安全編碼(原書第2版)
- Building Mapping Applications with QGIS
- JavaScript動態網頁開發詳解
- 深入RabbitMQ
- Gradle for Android
- 全棧自動化測試實戰:基于TestNG、HttpClient、Selenium和Appium
- JavaCAPS基礎、應用與案例
- Getting Started with React Native
- Deep Learning for Natural Language Processing
- Mastering Python
- Python面向對象編程(第4版)
- Building E-Commerce Solutions with WooCommerce(Second Edition)