Python的设计哲学--zen of Python
Python的设计哲学--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.虽然这种 方式可能不容易,除非你是python之父
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! 命名空间是一种绝妙的理念,应当多加利用
这就是 Python 之禅,Guido van Rossum一定是个有趣的人,能将设计思想展现在python解释器中,在“hello world”程序开始之前,它还有一番人生哲学啊
Python的设计哲学--zen of Python的更多相关文章
- Python的设计哲学探究
在Python shell中输入import this就会在屏幕上打印出来Python的设计哲学,如下: In [25]: import this The Zen of Python, by Tim ...
- Python的设计哲学
Beautiful is better than ugly. 优美胜于丑陋 Explicit is better than implicit. 明了胜于晦涩 Simple is better than ...
- Python基础教程(004)--Python的设计哲学
前言 Python已经成为了一门流行的编程语言. 知识点 1,优雅 2,明确 3,简单 Python开发者的哲学是:用一种方法,最好是只有一种方法来做一件事. 如果面临多种选择,Python开发者都会 ...
- python之禅 the zen of python
>>> import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is ...
- Python import this : The Zen of Python
>>> import thisThe Zen of Python, by Tim Peters Beautiful is better than ugly.Explicit is b ...
- 什么是Python?Python的设计哲学?如何获取/升级Python?
Python? Python(英国发音:/ˈpaɪθən/ 美国发音:/ˈpaɪθɑːn/) Python的创始人为吉多·范罗苏姆(Guido van Rossum). 1989年的圣诞节期间,吉多· ...
- funny_python 00 The Zen of Python
# 打算每天多动的时候尽量搜索一些和coding相关的funny stuff Day 00 - PEP 20 The Zen of Python 在shell里面输入python -m this 回车 ...
- Go for Pythonistas Go and the Zen of Python 禅
Go for Pythonistas https://talks.golang.org/2013/go4python.slide#1 Things I don't like about Python ...
- ######【Python】【基础知识】Python的介绍 ######
Python 是一种面向对象.解释型计算机程序设计语言. Python是什么? Python(英国发音:/ˈpaɪθən/ 美国发音:/ˈpaɪθɑːn/), 是一种面向对象的解释型计算机程序设计语言 ...
随机推荐
- iFrmae_HTML
iframe(HTML框架) <iframe src="URL"></iframe> 该URL指向的页面 会显示在当前页面的一个窗口上,默认大小为 widt ...
- CTF必备技能丨Linux Pwn入门教程——ShellCode
这是一套Linux Pwn入门教程系列,作者依据i春秋Pwn入门课程中的技术分类,并结合近几年赛事中出现的一些题目和文章整理出一份相对完整的Linux Pwn教程. 课程回顾>> Linu ...
- SQLi-LABS Page-2 (Adv Injections) Less27-Less29
Less-27 GET - Error Based- All your UNION and select belong to us 过滤了union 和select的报错注入 查看源码: 使用%09 ...
- 英语NanyangJade南阳玉NanyangJade独山玉
南阳玉NanyangJade又叫做独山玉,独山玉,因产于河南南阳的独山而得名,亦称“南阳玉”. 独山玉是中国四大名玉之一,有南阳翡翠之称,独山玉是一种黝帘石化斜长岩,由多种矿物组成,属多色玉器. 据文 ...
- shuffle调优
目录 一.概述 二.shuffle的定义 三.ShuffleMananger发展概述 四.HashShuffleManager的运行原理 4.1 未经优化的HashShuffleManager 4.2 ...
- python 自带模块 os模块
os模块 首先可以打开cmd输入python进入交互界面 然后输入 dir(os) 就可以看到os的全部用法了 我们简单的举几个例子就行了. 写入os.getcwd() 可以查看当前所在路径 i ...
- if,for,异常,random模块,计算圆周率
一.分支结构 单分支结构 if 一般用于判断选择 score = 95 if score > 90: print('优秀') 双分支结构 if...else age = 20 if age &g ...
- 模板渲染 templates
目录 一.模板含义 二.模板的组成 三.逻辑控制代码 变量 标签 自定义过滤器 模板继承 一.模板含义 模板虽然是HTML文件,但是Django不是直接把HTML文件返回给用户,而是经过了 模板语言的 ...
- echarts-中的事件-- demo1.on('事件类型', function (params) {}
ECharts 支持常规的鼠标事件类型,包括 'click'.'dblclick'.'mousedown'.'mousemove'. 'mouseup'.'mouseover'.'mouseout'. ...
- css 序
盒模型 1.属性:width :内容的宽度 书写内容的宽度 height:内容的高度 书写内容的宽度 padding:内边框 内容到边框的距离 可以有 background-color borde ...