测试开发技术网站
博客
设计
设计
开发
Python
测试
unittest
运维
Linux基础应用
CI/CD
CI/CD
数据库
数据库
云计算
云计算
云原生
云原生
爬虫
爬虫
数据分析
数据分析
人工智能
人工智能
登录
注册
Python之禅
收藏本文
作者:redrose2100 类别: 日期:2022-05-10 02:04:54 阅读:879 次 消耗积分:0 分
[TOC] # 1、import this 开启Python之禅 ```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! >>> ``` # 2、Python之禅(中文) * 优美胜于丑陋, * 明了胜于晦涩。 * 简洁胜于复杂, * 复杂胜于凌乱。 * 扁平胜于嵌套, * 稀疏胜于密繁。 * 可读性很重要! * 即便假借特例的实用性之名,也不可违背这些规则。 * 不要放过一切错误,除非错误本身需要以忽略对待。 * 不确定面前,我们应抵挡妄加猜测的引诱。 * 应该有一种,也但愿只有这一种是显而易见的解决之道。 * 万事开头难,除非荷兰人。 * 做好过不做,而不假思索就动手还不如不做。 * 如果某个实现无法很好阐释,那么它肯定是一个糟糕的办法; * 如果某个实现很容易说清楚,那么它可能就是个不错的方案。 * 命名空间是个绝妙的发明——对此我们应多多益善!
始终坚持开源开放共享精神,同时感谢您的充电鼓励和支持!
版权所有,转载本站文章请注明出处:redrose2100, http://blog.redrose2100.com/article/131
上一篇:
Python中魔法函数__getattr__/__setattr__/__delattr__/__getattribute__的使用方法
下一篇:
Python中多继承和MRO继承机制
搜索
个人成就
出版书籍
《Pytest企业级应用实战》
测试开发技术全栈公众号
测试开发技术全栈公众号
DevOps技术交流微信群
加微信邀请进群
常用网站链接
开源软件洞察
云原生技术栈全景图
Python语言官方文档
Golang官方文档
Docker官方文档
Jenkins中文用户手册
Scrapy官方文档
VUE官方文档
Harbor官方文档
openQA官方文档
云原生开源社区
开源中国
Kubernetes中文文档
Markdown语法官方教程
Kubernetes中文社区
Kubersphere官方文档
BootStrap中文网站
JavaScript中文网
NumPy官方文档
Pandas官方文档
GitLink确实开源网站
数据库排名网站
编程语言排名网站
SEO综合查询网站
数学加减法练习自动生成网站
Kickstart Generator
文章分类
最新文章
最多阅读
特别推荐
×
Close
登录
注册
找回密码
登录邮箱:
登录密码:
图片验证码:
注册邮箱:
注册密码:
邮箱验证码:
发送邮件
注册邮箱:
新的密码:
邮箱验证码:
发送邮件