Fluent Python

Luciano Ramalho

出版时间

2015-08-20

ISBN

9781491946008

评分

★★★★★
书籍介绍
Learn how to write idiomatic, effective Python code by leveraging its best features. Python's simplicity quickly lets you become productive with it, but this often means you aren’t using everything the language has to offer. By taking you through Python’s key language features and libraries, this practical book shows you how to make your code shorter, faster, and more readable all at the same time—what experts consider Pythonic. Many programmers who learn Python basics fall into the trap of reinventing the wheel because of past experience in other languages, and try to bend the language to patterns that don't really apply to it. Author Luciano Ramalho, a Python Software Foundation member and Python programmer for 15 years, helps you drop your accent from another language so you can code Python fluently. •Learn practical applications of generators for database processing •Rethink some design patterns in a Python context •Examine attribute descriptors and when to use them: the key to ORMs •Explore Pythonic objects: protocols versus interfaces, abstract base classes and multiple inheritance
AI导读
核心看点
  • 深入解析Python数据模型,掌握魔术方法
  • 摒弃其他语言思维,写出地道Pythonic代码
  • 详解元编程、协程等高级特性与底层原理
适合谁读
  • 具备Python基础,渴望进阶提升的开发者
  • 希望优化代码质量,追求简洁高效编程者
  • 对Python语言设计哲学感兴趣的程序员
读前提醒
  • 非入门书,需具备一定Python编程经验
  • 内容详实厚重,建议结合实践代码阅读
  • 部分高级主题较深,可配合延伸阅读材料
读者共识
  • Python进阶必读经典,口碑极佳的技术书
  • 作者文笔流畅,旁征博引,阅读体验极佳
  • 深度与广度兼备,能显著提升编程思维

本导读基于书籍简介、目录、原文摘录、短评和书评生成,不等同于全文精读。

精彩摘录
  • "加州大学两位教授(Brian Harvey 和Matthew Wright)的课件 -- 两种计算机科学的教学观点: 保守观点 计算机程序在人类的思维中会变得非常庞大和复杂。因此,计算机科学教育的目的是教会人们如何训练它们的编程能力,比如以这种方式--让500个平庸的程序员聚集在一起,给出规格让他们生产出一个程序。 激进观点 计算机程序在人类的思维中会变得非常庞大和复杂。因此,计算机科学教育的目的是教会人们如何扩展自己的思维以和程序契合,学习更多的概念,将会比单一解决方法更加弹性和有用。一个程序每个单元的编程的想法都必须统观全局。"
  • "发送时要保守,接收时要大方。 ——伯斯塔尔定律,又称稳健性法则"
  • "Strong versus weak typing If the language rarely performs implicit conversion of types, it’s considered strongly typed; if it often does it, it’s weakly typed. Java, C++, and Python are strongly typed. PHP, JavaScript, and Perl are weakly typed. Static versus dynamic typing If type-checking is perfo"
  • "If a class is designed to provide method implementations for reuse by multiple unrelated subclasses, without implying an “is-a” relationship, it should be an explicit mixin class. Conceptually, a mixin does not define a new type; it merely bundles methods for reuse. A mixin should never be instantia"
  • "The second edition of Python Cookbook was written for Python 2.4, but much of its code works with Python 3, and a lot of the recipes in Chapters 5 and 6 deal with sequences. The book was edited by Alex Martelli, Anna Martelli Ravenscroft, and David Ascher, and it includes contributions by dozens of "
  • "Operating with objects regardless of their types, as long as they implement certain protocols"
  • "Changing a class or module at runtime, without touching the source code"
  • "You can think of the data model as a description of Python as a framework."
作者简介
Luciano Ramalho was a Web developer before the Netscape IPO in 1995, and switched from Perl to Java to Python in 1998. Since then he worked on some of the largest news portals in Brazil using Python, and taught Python web development in the Brazilian media, banking and government sectors. His speaking credentials include PyCon US (2013), OSCON (2002, 2013), and 15 talks over the years at PythonBrasil (the Brazilian PyCon) and FISL (the largest FLOSS conference in the Southern Hemisphere). Ramalho is a member of the Python Software Foundation and co-founder of Garoa Hacker Clube, the first hackerspace in Brazil. He is co-owner of Python.pro.br, atraining company.
用户评论
内容很多,然而我并没有耐心仔细看
good enough
难得的互补官方文档的语言书
大开眼界
深度广度俱佳,举例与理论契合,补充材料丰富,文字通畅,读起来十分过瘾。唯一有点不喜欢的地方是 coroutine、GIL、asyncio 有很多小细节需要自己去抠,书里没法面面俱到。不过这三个主题本身就很鸡毛,能引人入门就很不错了~
中文版看不明白的时候对照着原版看看。
作者试着从一个更深入的角度来讲解python的设计哲学,引用了若干历史上做决定的过程(比如maillist或者PEPlink),可以帮助读者了解深入的背景。书的有些部分写的有点过于自嗨?,如果在有些地方能够和其他语言来比较一下,讲清楚python当前设计思想下可能存在的问题,就更好了 -
读得差不多了,直接坐等第二版。
读过关于python最好的书, 非常透彻, 这本书才让我感觉有一些了解python了
难懂得要死
收藏