Python学习笔记 七:Zen of Python(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之父Guido)
  • 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!:命名空间非常有用,我们应当多加利用
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Jackson的生态模型

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值