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/), 是一种面向对象的解释型计算机程序设计语言 ...
随机推荐
- Seata为什么效率高
1. Seata为什么效率高 1.1. 应对面试官的解释 Seata的解决方案是两阶段提交的升级版,传统两阶段提交资源管理器(RM)放在数据库端,由数据库管理,需要数据库支持XA协议. 而Seata把 ...
- npm install 报错 -4048
方法1: 删除npmrc文件. 强调:不是nodejs安装目录npm模块下的那个npmrc文件,而是在C:\Users\{账户}\下的.npmrc文件. 方法2: https://www.jiansh ...
- pipenv管理python开发环境
简介 简单说,pipenv就是把pip和virtualenv包装起来的一个便携工具. 它不会在你的项目文件夹里生成一大堆东西,只有两个文本文件: Pipfile, 简明地显示项目环境和依赖包. Pip ...
- Ubuntu启动器快捷方式文件解析
快捷方式名称 app_name.desktop 路径: /usr/share/applications/app_name.desktop # 简洁快捷方式格式 [Desktop Entry] Name ...
- XGBoost和LightGBM的参数以及调参
一.XGBoost参数解释 XGBoost的参数一共分为三类: 通用参数:宏观函数控制. Booster参数:控制每一步的booster(tree/regression).booster参数一般可以调 ...
- 封装tab组件
=====>tab切换组件的封装 wx:key="{{index}} 绑定标识 它的下标是从0开始的 {{currentIndex==index ? "active" ...
- Mybatis-plus使用分页进行分页查询
首先先配置配置文件 @Configuration public class MybatisPlusConfig { @Bean public PaginationInterceptor paginat ...
- webdriver模拟鼠标操作
ActionChains 生成模拟用户操作的对象 from selenium.webdriver.common.action_chains import ActionChains ActionChai ...
- Codeforces Round #545 (Div. 2) 交互 + 推公式
https://codeforces.com/contest/1138/problem/F 题意 有一条长为t的链,一个长为c的环,定义终点为链和环相连环上的第一个点,现在有10个人在起点,你每次可以 ...
- [LeetCode] 644. Maximum Average Subarray II 子数组的最大平均值之二
Given an array consisting of n integers, find the contiguous subarray whose length is greater than o ...