O’Reilly Media, 2015- 770 p.; ISBN13: 978-1-4919-4599-5;
Language: English
Book DescriptionPython’s simplicity lets you become productive quickly, but this often means you aren’t using everything it has to offer. With this hands-on guide, you’ll learn how to write effective, idiomatic Python code by leveraging its best — and possibly most neglected — features. Author Luciano Ramalho takes you through Python’s core language features and libraries, and shows you how to make your code shorter, faster, and more readable at the same time.
Many experienced programmers try to bend Python to fit patterns they learned from other languages, and never discover Python features outside of their experience. With this book, those Python programmers will thoroughly learn how to become proficient in Python 3.
Part I. Prologue
The Python Data Model
An array of sequences
Dictionaries and sets
Text versus bytes
Part III. Functions as objects
First-class functions
Design patterns with first-class functions
Function decorators and closures
Object references, mutability and recycling
A Pythonic object
Sequence hacking, hashing and slicing
Interfaces: from protocols to ABCs
Inheritance: for good or for worse
Operator overloading: doing it right
Part V. Control flow
Iterables, iterators and generators
Context managers and else blocks
Coroutines
Concurrency with futures
Concurrency with asyncio
Part VI. Metaprogramming
Dynamic attributes and properties
Attribute descriptors
Class metaprogramming
A. Support scripts
Python jargon