
作者:Luciano Ramalho著
页数:742
出版社:东南大学出版社
出版日期:2017
ISBN:9787564168742
电子书格式:pdf/epub/txt
内容简介
Python是一种面向对象、解释型计算机程序设计语言。Python具有丰富和强大的库。它常被昵称为胶水语言,能够把用其他语言制作的各种模块(尤其是C/C++)很轻松地联结在一起。常见的一种应用情形是,使用Python快速生成程序的原型(有时甚至是程序的最终界面),然后对其中有特别要求的部分,用更合适的语言改写,比如3D游戏中的图形渲染模块,性能要求特别高,就可以用C/C++重写,而后封装为Python可以调用的扩展类库。需要注意的是在您使用扩展类库时可能需要考虑平台问题,某些可能不提供跨平台的实现。本书讲述Python技术。
本书特色
Python的简洁让你可以快速达到高产水平,但是 这通常意味着你并没有用到它提供的所有功能特性。
有了卢西亚诺·拉马略最的《流利的Python语言(影 印版)(英文版)》这本容易上手的指南,你将学会 如何利用那些十分第一但很容易被忽视的特性来编写 有效且通顺的Python代码。作者Luciano Ramalho将 带领你们遍历Python的核心语言特性和程序库,并展 示精简代码、优化速度和可读性的方法。
很多富有经验的程序员尝试将Python扭曲成适合 他们从其他语言中学到的模式,而从未发现超出他们 经验的Python特性。通过这本书,那些Python程序员 将完全学会如何高效率地使用Python 3。
目录
PrefacePart I. Prologue
1. The Python Data ModelA Pythonic Card DeckHow Special Methods Are UsedEmulating Numeric TypesString RepresentationArithmetic OperatorsBoolean Value of a Custom TypeOverview of Special MethodsWhy len Is Not a MethodChapter SummaryFurther ReadingPart II. Data Structures
2. An Array of SequencesOverview of Built-In SequencesList Comprehensions and Generator ExpressionsList Comprehensions and ReadabilityListcomps Versus map and filterCartesian ProductsGenerator ExpressionsTuples Are Not Just Immutable ListsTuples as RecordsTuple UnpackingNested Tuple UnpackingNamed TuplesTuples as Immutable ListsSlicingWhy Slices and Range Exclude the Last ItemSlice ObjectsMultidimensional Slicing and EllipsisAssigning to SlicesUsing and 最 with SequencesBuilding Lists of ListsAugmented Assignment with SequencesA = Assignment Puzzlerlist.sort and the sorted Built-In FunctionManaging Ordered Sequences with bisectSearching with bisectInserting with bisect.insortWhen a List Is Not the AnswerArraysMemory ViewsNumPy and SciPyDeques and Other QueuesChapter SummaryFurther Reading
3. Dictionaries and SetsGeneric Mapping Typesdict ComprehensionsOverview of Common Mapping MethodsHandling Missing Keys with setdefaultMappings with Flexible Key Lookupdefaultdict: Another Take on Missing KeysThe___ missing___ MethodVariations of dictSubclassing UserDictImmutable MappingsSet Theoryset LiteralsSet ComprehensionsSet Operationsdict and set Under the HoodA Performance ExperimentHash Tables in Dictionaries……Part III. Functions as Objects
Part IV. Object-Orientedldioms
Part V. Control Flow
Part VI. Metaprogramming
Afterword
A. Support Scripts
Python Jargon
Index














