fluent_python_2nd_edition_by_luciano_ramalho_table_of_contents

Fluent Python, 2nd Edition by Luciano Ramalho Table of Contents

I. Prologue

II. Data Structures

II. Data Structures

4. Text versus Bytes - Character Issues

Byte Essentials - Structs and Memory Views

Basic Encoders/De[[coders

Understanding Encode/Decode Problems Coping with UnicodeEncodeError

Coping with UnicodeDecodeError

SyntaxError When Loading Modules with Unexpected Encoding

How to Discover the Encoding of a Byte Sequence

BOM: A Useful Gremlin

Handling Text Files Encoding Defaults: A Madhouse

Normalizing Unicode for Saner Comparisons - Case Folding

Utility Functions for Normalized Text Matching

ExtremeNormalization”: Taking Out Diacritics

Sorting Unicode Text Sorting with the Unicode Collation Algorithm

The Unicode Database

Dual-Mode str and bytes APIs str Versus bytes in Regular Expressions

str Versus bytes on os Functions

Chapter Summary

Further Reading

III. Functions as Objects

IV. Object-Oriented Idioms

IV. Object-Oriented Idioms

8. Object References, Mutability, and Recycling Variables Are Not Boxes

Identity, Equality, and Aliases Choosing Between == and is

The Relative Immutability of Tuples

Copies Are Shallow by Default - Deep and Shallow Copies of Arbitrary Objects

Function Parameters as References - Mutable Types as Parameter Defaults: Bad Idea

Defensive Programming with Mutable Parameters

del and Garbage Collection

Weak References The WeakValueDictionary Skit

Limitations of Weak References

Tricks Python Plays with Immutables

Chapter Summary

Further Reading

9. A Pythonic Object Object Representations

Vector Class Redux

An Alternative Constructor

classmethod Versus staticmethod

Formatted Displays

A Hashable Vector2d

Private and “ProtectedAttributes in Python

Saving Space with the __slots__ Class Attribute - The Problems with __slots__ (dunder slots)

Overriding Class Attributes

Chapter Summary

Further Reading

10. Sequence Hacking, Hashing, and Slicing Vector: A User-Defined Sequence Type

Vector Take #1: Vector2d Compatible

Protocols and Duck Typing

Vector Take #2: A Sliceable Sequence How Slicing Works

A Slice-Aware __getitem__ (dunder getitem)

Vector Take #3: Dynamic Attribute Access

Vector Take #4: Hashing and a Faster ==

Vector Take #5: Formatting

Chapter Summary

Further Reading

11. Interfaces: From Protocols to ABCs - Interfaces and Protocols in Python Culture

Python Digs Sequences

Monkey-Patching to Implement a Protocol at Runtime

Alex Martelli’s Waterfowl

Subclassing an ABC

ABCs in the Standard Library ABCs in collections.abc

The Numbers Tower of ABCs

Defining and Using an ABC - ABC Syntax Details

Subclassing the Tombola ABC

A Virtual Subclass of Tombola

How the Tombola Subclasses Were Tested

Usage of register in Practice

Geese Can Behave as Ducks

Chapter Summary

Further Reading

12. Inheritance: For Good or For Worse Subclassing Built-In Types Is Tricky

Multiple Inheritance and Method Resolution Order

Multiple Inheritance in the Real World

Coping with Multiple Inheritance - 1. Distinguish Interface Inheritance from Implementation Inheritance

2. Make Interfaces Explicit with ABCs

3. Use Mixins for Code Reuse

4. Make Mixins Explicit by Naming

5. An ABC May Also Be a Mixin; The Reverse Is Not True

6. Don't Subclass from More Than One Concrete [[Class

7. Provide Aggregate Classes to Users

8. “Favor Object Composition Over Class Inheritance.”

Tkinter: The Good, the Bad, and the Ugly

A Modern Example: Mixins in Django Generic Views

Chapter Summary

Further Reading

13. Operator Overloading: Doing It Right Operator Overloading 101

Unary [[Operators

Overloading + for Vector Addition

Overloading

Rich Comparison Operators

Augmented Assignment Operators

Chapter Summary

Further Reading

==V. Control Flow==
V. Control Flow

14. Iterables, Iterators, and Generators Sentence Take #1: A Sequence of Words Why Sequences Are Iterable: The iter Function

Iterables Versus Iterators

Sentence Take #2: A Classic Iterator Making Sentence an Iterator: Bad Idea

Sentence Take #3: A Generator Function How a Generator Function Works

Sentence Take #4: A Lazy Implementation

Sentence Take #5: A Generator Expression

Generator Expressions: When to Use Them

Another Example: Arithmetic Progression Generator Arithmetic Progression with itertools

Generator Functions in the Standard Library

New Syntax in Python 3.3: yield from

Iterable Reducing Functions

A Closer Look at the iter Function

Case Study: Generators in a Database Conversion Utility

Generators as Coroutines

Chapter Summary

Further Reading

15. Context Managers and else Blocks Do This, Then That: else Blocks Beyond if

Context Managers and with Blocks

The contextlib Utilities

Using @contextmanager

Chapter Summary

Further Reading

16. Coroutines How Coroutines Evolved from Generators

Basic Behavior of a Generator Used as a Coroutine

Example: Coroutine to Compute a Running Average

Decorators for Coroutine Priming

Coroutine Termination and Exception Handling

Returning a Value from a Coroutine

Using yield from

The Meaning of yield from

Use Case: Coroutines for Discrete Event Simulation About Discrete Event Simulations

The Taxi Fleet Simulation

Chapter Summary

Further Reading

17. Concurrency with Futures Example: Web Downloads in Three Styles A Sequential Download Script

Downloading with concurrent.futures

Where Are the Futures?

Blocking I/O and the GIL

Launching Processes with concurrent.futures

Experimenting with Executor.map

Downloads with Progress Display and Error Handling Error Handling in the flags2 Examples

Using futures.as_completed

Threading and Multiprocessing Alternatives

Chapter Summary

Further Reading

18. Concurrency with asyncio Thread Versus Coroutine: A Comparison asyncio.Future: Nonblocking by Design

Yielding from Futures, Tasks, and Coroutines

Downloading with asyncio and aiohttp

Running Circles Around Blocking Calls

Enhancing the asyncio downloader Script Using asyncio.as_completed

Using an Executor to Avoid Blocking the Event Loop

From Callbacks to Futures and Coroutines Doing Multiple Requests for Each Download

Writing asyncio Servers An asyncio TCP Server

An aiohttp Web Server

Smarter Clients for Better Concurrency

Chapter Summary

Further Reading

VI. Metaprogramming

VI. Metaprogramming

19. Dynamic Attributes and Properties Data Wrangling with Dynamic Attributes Exploring JSON-Like Data with Dynamic Attributes

The Invalid Attribute Name Problem

Flexible Object Creation with __new__ (dunder new)

Restructuring the OSCON Feed with shelve

Linked Record Retrieval with Properties

Using a Property for Attribute Validation LineItem Take #1: Class for an Item in an Order

LineItem Take #2: A Validating Property

A Proper Look at Properties Properties Override Instance Attributes

Property Documentation

Coding a Property Factory

Handling Attribute Deletion

Essential Attributes and Functions for Attribute Handling Special Attributes that Affect Attribute Handling

Built-In Functions for Attribute Handling

Special Methods for Attribute Handling

Chapter Summary

Further Reading

20. Attribute Descriptors Descriptor Example: Attribute Validation LineItem Take #3: A Simple Descriptor

LineItem Take #4: Automatic Storage Attribute Names

LineItem Take #5: A New Descriptor Type

Overriding Versus Nonoverriding Descriptors Overriding Descriptor

Overriding Descriptor Without __get__

Nonoverriding Descriptor

Overwriting a Descriptor in the Class

Methods Are Descriptors

Descriptor Usage Tips

Descriptor docstring and Overriding Deletion

Chapter Summary

Further Reading

21. Class Metaprogramming A Class Factory

A Class Decorator for Customizing Descriptors

What Happens When: Import Time Versus Runtime The Evaluation Time Exercises

Metaclasses 101 The Metaclass Evaluation Time Exercise

A Metaclass for Customizing Descriptors

The Metaclass __prepare__ Special Method (dunder prepare)

Classes as Objects

Chapter Summary

Further Reading

Afterword Further Reading

A. Support Scripts Chapter 3: in Operator Performance Test

Chapter 3: Compare the Bit Patterns of Hashes

Chapter 9: RAM Usage With and Without __slots__

Chapter 14: isis2json.py Database Conversion Script

Chapter 16: Taxi Fleet Discrete Event Simulation

Chapter 17: Cryptographic Examples

Chapter 17: flags2 HTTP Client Examples

Chapter 19: OSCON Schedule Scripts and Tests

Python Jargon

Index

Python: Python Variables, Python Data Types, Python Control Structures, Python Loops, Python Functions, Python Modules, Python Packages, Python File Handling, Python Errors and Exceptions, Python Classes and Objects, Python Inheritance, Python Polymorphism, Python Encapsulation, Python Abstraction, Python Lists, Python Dictionaries, Python Tuples, Python Sets, Python String Manipulation, Python Regular Expressions, Python Comprehensions, Python Lambda Functions, Python Map, Filter, and Reduce, Python Decorators, Python Generators, Python Context Managers, Python Concurrency with Threads, Python Asynchronous Programming, Python Multiprocessing, Python Networking, Python Database Interaction, Python Debugging, Python Testing and Unit Testing, Python Virtual Environments, Python Package Management, Python Data Analysis, Python Data Visualization, Python Web Scraping, Python Web Development with Flask/Django, Python API Interaction, Python GUI Programming, Python Game Development, Python Security and Cryptography, Python Blockchain Programming, Python Machine Learning, Python Deep Learning, Python Natural Language Processing, Python Computer Vision, Python Robotics, Python Scientific Computing, Python Data Engineering, Python Cloud Computing, Python DevOps Tools, Python Performance Optimization, Python Design Patterns, Python Type Hints, Python Version Control with Git, Python Documentation, Python Internationalization and Localization, Python Accessibility, Python Configurations and Environments, Python Continuous Integration/Continuous Deployment, Python Algorithm Design, Python Problem Solving, Python Code Readability, Python Software Architecture, Python Refactoring, Python Integration with Other Languages, Python Microservices Architecture, Python Serverless Computing, Python Big Data Analysis, Python Internet of Things (IoT), Python Geospatial Analysis, Python Quantum Computing, Python Bioinformatics, Python Ethical Hacking, Python Artificial Intelligence, Python Augmented Reality and Virtual Reality, Python Blockchain Applications, Python Chatbots, Python Voice Assistants, Python Edge Computing, Python Graph Algorithms, Python Social Network Analysis, Python Time Series Analysis, Python Image Processing, Python Audio Processing, Python Video Processing, Python 3D Programming, Python Parallel Computing, Python Event-Driven Programming, Python Reactive Programming.

Variables, Data Types, Control Structures, Loops, Functions, Modules, Packages, File Handling, Errors and Exceptions, Classes and Objects, Inheritance, Polymorphism, Encapsulation, Abstraction, Lists, Dictionaries, Tuples, Sets, String Manipulation, Regular Expressions, Comprehensions, Lambda Functions, Map, Filter, and Reduce, Decorators, Generators, Context Managers, Concurrency with Threads, Asynchronous Programming, Multiprocessing, Networking, Database Interaction, Debugging, Testing and Unit Testing, Virtual Environments, Package Management, Data Analysis, Data Visualization, Web Scraping, Web Development with Flask/Django, API Interaction, GUI Programming, Game Development, Security and Cryptography, Blockchain Programming, Machine Learning, Deep Learning, Natural Language Processing, Computer Vision, Robotics, Scientific Computing, Data Engineering, Cloud Computing, DevOps Tools, Performance Optimization, Design Patterns, Type Hints, Version Control with Git, Documentation, Internationalization and Localization, Accessibility, Configurations and Environments, Continuous Integration/Continuous Deployment, Algorithm Design, Problem Solving, Code Readability, Software Architecture, Refactoring, Integration with Other Languages, Microservices Architecture, Serverless Computing, Big Data Analysis, Internet of Things (IoT), Geospatial Analysis, Quantum Computing, Bioinformatics, Ethical Hacking, Artificial Intelligence, Augmented Reality and Virtual Reality, Blockchain Applications, Chatbots, Voice Assistants, Edge Computing, Graph Algorithms, Social Network Analysis, Time Series Analysis, Image Processing, Audio Processing, Video Processing, 3D Programming, Parallel Computing, Event-Driven Programming, Reactive Programming.


Python Glossary, Python Fundamentals, Python Inventor: Python Language Designer: Guido van Rossum on 20 February 1991; PEPs, Python Scripting, Python Keywords, Python Built-In Data Types, Python Data Structures - Python Algorithms, Python Syntax, Python OOP - Python Design Patterns, Python Module Index, pymotw.com, Python Package Manager (pip-PyPI), Python Virtualization (Conda, Miniconda, Virtualenv, Pipenv, Poetry), Python Interpreter, CPython, Python REPL, Python IDEs (PyCharm, Jupyter Notebook), Python Development Tools, Python Linter, Pythonista-Python User, Python Uses, List of Python Software, Python Popularity, Python Compiler, Python Transpiler, Python DevOps - Python SRE, Python Data Science - Python DataOps, Python Machine Learning, Python Deep Learning, Functional Python, Python Concurrency - Python GIL - Python Async (Asyncio), Python Standard Library, Python Testing (Pytest), Python Libraries (Flask), Python Frameworks (Django), Python History, Python Bibliography, Manning Python Series, Python Official Glossary - Python Glossary, Python Topics, Python Courses, Python Research, Python GitHub, Written in Python, Python Awesome List, Python Versions. (navbar_python - see also navbar_python_libaries, navbar_python_standard_library, navbar_python_virtual_environments, navbar_numpy, navbar_datascience)

Fair Use Sources


© 1994 - 2024 Cloud Monk Losang Jinpa or Fair Use. Disclaimers

SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.


fluent_python_2nd_edition_by_luciano_ramalho_table_of_contents.txt · Last modified: 2024/04/28 03:36 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki