作者:
Brett Slatkin
出版社: Addison-Wesley Professional
副标题: 90 Specific Ways to Write Better Python
出版年: 2019-11-22
页数: 480
定价: USD 49.99
装帧: Paperback
ISBN: 9780134853987
出版社: Addison-Wesley Professional
副标题: 90 Specific Ways to Write Better Python
出版年: 2019-11-22
页数: 480
定价: USD 49.99
装帧: Paperback
ISBN: 9780134853987
豆瓣评分
作者简介 · · · · · ·
Google高级软件工程师Brett Slatkin融合自己多年Python开发实战经验,深入探讨编写高质量Python代码的技巧、禁忌和最佳实践。
涵盖Python3.x和Python2.x主要应用领域,汇聚59条优秀实践原则、开发技巧和便捷方案,包含大量实用范例代码。
目录 · · · · · ·
Preface
Chapter 1 Pythonic Thinking
Chapter 2 Lists and Dictionaries
Chapter 3 Functions
Chapter 4 Comprehensions and Generators
Chapter 5 Classes and Interfaces
· · · · · · (更多)
Chapter 1 Pythonic Thinking
Chapter 2 Lists and Dictionaries
Chapter 3 Functions
Chapter 4 Comprehensions and Generators
Chapter 5 Classes and Interfaces
· · · · · · (更多)
Preface
Chapter 1 Pythonic Thinking
Chapter 2 Lists and Dictionaries
Chapter 3 Functions
Chapter 4 Comprehensions and Generators
Chapter 5 Classes and Interfaces
Chapter 6 Metaclasses and Attributes
Chapter 7 Concurrency and Parallelism
Chapter 8 Robustness and Performance
Chapter 9 Testing and Debugging
Chapter 10 Collaboration
Index
· · · · · · (收起)
Chapter 1 Pythonic Thinking
Chapter 2 Lists and Dictionaries
Chapter 3 Functions
Chapter 4 Comprehensions and Generators
Chapter 5 Classes and Interfaces
Chapter 6 Metaclasses and Attributes
Chapter 7 Concurrency and Parallelism
Chapter 8 Robustness and Performance
Chapter 9 Testing and Debugging
Chapter 10 Collaboration
Index
· · · · · · (收起)
原文摘录 · · · · · ·
-
class LazyDB(object): def __init__(self): self.exists = 5 def __getattr__(self, name): value = 'Value for {}'.format(name) print 'hhhhh' setattr(self, name, value) return value class LoggingLazyDB(LazyDB): def __getattr__(self, name): print 'Called __getattr__{}'.format(name) return super().__getattr__(name) data = LoggingLazyDB() print 'foo exists: {}'.format(hasattr(data, 'foo')) >>> Called __getattr__foo >>> foo exists: False (查看原文) —— 引自第99页
喜欢读"Effective Python: Second Edition"的人也喜欢 · · · · · ·
Effective Python: Second Edition的书评 · · · · · · ( 全部 6 条 )



编写高质量python代码的90个有效方法
《Effective Python:编写高质量Python代码的90个有效方法》是一本Python开发者必读的书。本书的作者Brett Slatkin是一位工业级的Python程序员,拥有多年的Python开发经验。他在书中分享了他自己的实践经验,并将这些经验总结为90个有用的技巧和实用的代码,帮助读者编写更为优...
(展开)

读effective python有感
这本书不是一本Python基础书,但是如果你时间少,强烈推荐就买这本书就完全可以了.看里面的代码,都是大师的作品,让我直呼,妙. This second edition book (to be published by Pearson Addison-Wesley in mid-November 2019) provides insight into the Pythonicway of writi...
(展开)

讲 OOP 和 metaclass 的部分比较好
其他部分(并发, 模块, 部署)大部分都了解, 更愿意看一下 OOP 的想法. 在这里稍微记一下. 尽量使用异常来表示特殊情况, 而不要 return None 现在看, 有两种比较棘手的情况: (1) 有时候一个方法里涉及数个含网络请求(which means 必须考虑失败)的调用, 会写成这样: def call0(): ...
(展开)

> 更多书评 6篇
论坛 · · · · · ·
在这本书的论坛里发言这本书的其他版本 · · · · · · ( 全部10 )
-
机械工业出版社 (2016)8.7分 328人读过
-
电子工业出版社 (2020)暂无评分 4人读过
-
机械工业出版社 (2021)8.9分 153人读过
-
Addison-Wesley Professional (2015)8.2分 92人读过
以下书单推荐 · · · · · · ( 全部 )
- CS推荐 (橄榄树萍)
谁读这本书? · · · · · ·
二手市场
· · · · · ·
- 在豆瓣转让 有46人想读,手里有一本闲着?
订阅关于Effective Python: Second Edition的评论:
feed: rss 2.0
1 有用 Renco 2020-03-09 00:03:18
本来想一条一条刷完,结果发现很多对我来说都不相关。不过书是好书,案头留一本,常翻常新。得是天天啪嗒啪嗒写Python的人可能读这本书受益最广。
0 有用 Alien 2024-12-07 07:38:04 英国
想熟悉Python最佳实践的话是值得读的 但其中有些建议并不赞同