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的更多相关文章

  1. Python的设计哲学探究

    在Python shell中输入import this就会在屏幕上打印出来Python的设计哲学,如下: In [25]: import this The Zen of Python, by Tim ...

  2. Python的设计哲学

    Beautiful is better than ugly. 优美胜于丑陋 Explicit is better than implicit. 明了胜于晦涩 Simple is better than ...

  3. Python基础教程(004)--Python的设计哲学

    前言 Python已经成为了一门流行的编程语言. 知识点 1,优雅 2,明确 3,简单 Python开发者的哲学是:用一种方法,最好是只有一种方法来做一件事. 如果面临多种选择,Python开发者都会 ...

  4. python之禅 the zen of python

    >>> import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is ...

  5. Python import this : The Zen of Python

    >>> import thisThe Zen of Python, by Tim Peters Beautiful is better than ugly.Explicit is b ...

  6. 什么是Python?Python的设计哲学?如何获取/升级Python?

    Python? Python(英国发音:/ˈpaɪθən/ 美国发音:/ˈpaɪθɑːn/) Python的创始人为吉多·范罗苏姆(Guido van Rossum). 1989年的圣诞节期间,吉多· ...

  7. funny_python 00 The Zen of Python

    # 打算每天多动的时候尽量搜索一些和coding相关的funny stuff Day 00 - PEP 20 The Zen of Python 在shell里面输入python -m this 回车 ...

  8. 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 ...

  9. ######【Python】【基础知识】Python的介绍 ######

    Python 是一种面向对象.解释型计算机程序设计语言. Python是什么? Python(英国发音:/ˈpaɪθən/ 美国发音:/ˈpaɪθɑːn/), 是一种面向对象的解释型计算机程序设计语言 ...

随机推荐

  1. 【IPHONE开发-OBJECTC入门学习】文件的操作,读写复制文件

    转自:http://blog.csdn.net/java886o/article/details/9041547 FileTools.h FileTools.m #import "FileT ...

  2. 剑指:和为S的连续正数序列

    题目描述 输入一个正数 s,打印出所有和为 s 的连续正数序列(至少含有两个数). 例如输入 15,由于 1+2+3+4+5=4+5+6=7+8=15,所以结果打印出 3 个连续序列 1-5.4-6 ...

  3. JavaScript中this究竟指向什么?

    摘要: 神奇的this! 原文:JS 中 this 在各个场景下的指向 译者:前端小智 Fundebug经授权转载,版权归原作者所有. 1. this 的奥秘 很多时候, JS 中的 this 对于咱 ...

  4. JAVA中为什么要配置环境变量?怎么配置环境变量?

    1.为什么要配置环境变量? 答:为了让javac命令(编译命令)和Java命令(运行命令)能在任何文件夹都能运行. 2.怎么配置环境变量? JAVA_HOME : D:\develop\Java\jd ...

  5. [基础]斯坦福cs231n课程视频笔记(三) 训练神经网络

    目录 training Neural Network Activation function sigmoid ReLU Preprocessing Batch Normalization 权重初始化 ...

  6. 今晚,玩一玩linux上的DNS

    老哥遇到的问题, 我先按正规方式操作一波. 一,安装dns服务 yum install bind bind-utils -y 二,修改/etc/named.conf文件 options { liste ...

  7. nginx发布静态资源

    nginx发布静态资源 参考 ngx_http_index_module index指令 ngx_http_core_module http指令 location指令 listen指令 root指令 ...

  8. 百度PaddlePaddle:

    百度正式发布PaddlePaddle深度强化学习框架PARL 近日,百度PaddlePaddle正式发布了深度强化学习框架 PARL,同时开源了基于该框架的.在 NeurIPS 2018 强化学习赛事 ...

  9. [POJ1952]BUY LOW, BUY LOWER

    题目描述 Description The advice to "buy low" is half the formula to success in the bovine stoc ...

  10. nginx使用多端口监听多个服务

    ###### nginx监听多个端口并转发给不同的服务 ### 第一个监听: upstream odoo { server localhost:; } upstream odoochat{ serve ...