Professional Python
Master the secret tools every Python programmer needs to knowProfessional Python goes beyond the basics to teach beginner- and intermediate-level Python programmers the little-known tools and constructs that build concise, maintainable code. Design better architecture and write easy-to-understand co...
Uloženo v:
| Hlavní autor: | |
|---|---|
| Médium: | E-kniha |
| Jazyk: | angličtina |
| Vydáno: |
Newark
John Wiley & Sons, Incorporated
2015
Wrox Wrox Press/John Wiley & Sons, Inc |
| Vydání: | 1 |
| Témata: | |
| ISBN: | 1119070856, 9781119070856 |
| On-line přístup: | Získat plný text |
| Tagy: |
Přidat tag
Žádné tagy, Buďte první, kdo vytvoří štítek k tomuto záznamu!
|
Obsah:
- Regular Expressions in Python -- Basic Regular Expressions -- Grouping -- Lookahead -- Flags -- Substitution -- Compiled Regular Expressions -- Summary -- Part IV: Everything Else -- Chapter 10: Python 2 Versus Python 3 -- Cross-Compatibility Strategies -- Changes in Python 3 -- Standard Library Relocations -- Version Detection -- Summary -- Chapter 11: Unit Testing -- The Testing Continuum -- Testing Code -- Unit Testing Frameworks -- Mocking -- Other Testing Tools -- Summary -- Chapter 12: CLI Tools -- OPTPARSE -- ARGPARSE -- Summary -- Chapter 13: asyncio -- The Event Loop -- Coroutines -- Futures and Tasks -- Callbacks -- Task Aggregation -- Queues -- Servers -- Summary -- Chapter 14: Style -- Principles -- Standards -- Summary -- End User License Agreement
- Intro -- Table of Contents -- Introduction -- Who This Book Is For -- What This Book Covers -- How This Book Is Structured -- What You Need to Use This Book -- Conventions -- Errata -- p2p.wrox.com -- Part I: Functions -- Chapter 1: Decorators -- Understanding Decorators -- Decorator Syntax -- Where Decorators Are Used -- Why You Should Write Decorators -- When You Should Write Decorators -- Writing Decorators -- Decorating Classes -- Type Switching -- Summary -- Chapter 2: Context Managers -- What Is a Context Manager? -- Context Manager Syntax -- When You Should Write Context Managers -- A Simpler Syntax -- Summary -- Chapter 3: Generators -- Understanding What a Generator Is -- Understanding Generator Syntax -- Communication with Generators -- Iterables Versus Iterators -- Generators in the Standard Library -- When to Write Generators -- When Are Generators Singletons? -- Generators within Generators -- Summary -- Part II: Classes -- Chapter 4: Magic Methods -- Magic Method Syntax -- Available Methods -- Other Magic Methods -- Summary -- Chapter 5: Metaclasses -- Classes and Objects -- Writing Metaclasses -- Using Metaclasses -- When to Use Metaclasses -- The Question of Explicit Opt-In -- Meta-Coding -- Summary -- Chapter 6: Class Factories -- A Review of type -- Understanding a Class Factory Function -- Determining When You Should Write Class Factories -- Summary -- Chapter 7: Abstract Base Classes -- Using Abstract Base Classes -- Declaring a Virtual Subclass -- Declaring a Protocol -- Built-in Abstract Base Classes -- Summary -- Part III: Data -- Chapter 8: Strings and Unicode -- Text String Versus Byte String -- Strings with Non-ASCII Characters -- Other Encodings -- Reading Files -- Reading Other Sources -- Specifying Python File Encodings -- Strict Codecs -- Summary -- Chapter 9: Regular Expressions -- Why Use Regular Expressions?

