Table of Contents
Fluent Python, 2nd Edition by Luciano Ramalho Table of Contents
Return to Fluent Python, 2nd Edition, Python, Python DevOps - Python Data Science - Python MLOps, Python Bibliography
I. Prologue
I. Prologue
- 1. The Python Data Model A Pythonic Card Deck
- How Special Methods Are Used Emulating Numeric Types
II. Data Structures
II. Data Structures
- list.sort and the sorted Built-In Function
4. Text versus Bytes - Character Issues
Byte Essentials - Structs and Memory Views
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
Handling Text Files Encoding Defaults: A Madhouse
Normalizing Unicode for Saner Comparisons - Case Folding
Utility Functions for Normalized Text Matching
Extreme “Normalization”: 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
III. Functions as Objects
III. Functions as Objects
5. First-Class Functions Treating a Function Like an Object
Higher-Order Functions - Modern Replacements for map, filter, and reduce
The Seven Flavors of Callable Objects
From Positional to Keyword-Only Parameters
Retrieving Information About Parameters
Packages for Functional Programming - The operator Module
Freezing Arguments with functools.partial
6. Design Patterns with First-Class Functions Case Study: Refactoring Strategy Classic Strategy
Choosing the Best Strategy: Simple Approach
Finding Strategies in a Module
7. Function Decorators and Closures Decorators 101
When Python Executes Decorators
Decorator-Enhanced Strategy Pattern
The nonlocal Declaration
Implementing a Simple Decorator How It Works
Decorators in the Standard Library Memoization with functools.lru_cache
Generic Functions with Single Dispatch
Parameterized Decorators A Parameterized Registration Decorator
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
Weak References The WeakValueDictionary Skit
Limitations of Weak References
Tricks Python Plays with Immutables
9. A Pythonic Object Object Representations
classmethod Versus staticmethod
Private and “Protected” Attributes in Python
Saving Space with the __slots__ Class Attribute - The Problems with __slots__ (dunder slots)
10. Sequence Hacking, Hashing, and Slicing Vector: A User-Defined Sequence Type
Vector Take #1: Vector2d Compatible
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
11. Interfaces: From Protocols to ABCs - Interfaces and Protocols in Python Culture
Monkey-Patching to Implement a Protocol at Runtime
ABCs in the Standard Library ABCs in collections.abc
Defining and Using an ABC - ABC Syntax Details
A Virtual Subclass of Tombola
How the Tombola Subclasses Were Tested
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
13. Operator Overloading: Doing It Right Operator Overloading 101
Overloading + for Vector Addition
- for Scalar Multiplication
Augmented Assignment Operators
==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
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
A Closer Look at the iter Function
Case Study: Generators in a Database Conversion Utility
15. Context Managers and else Blocks Do This, Then That: else Blocks Beyond if
Context Managers and with Blocks
The contextlib Utilities
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
The Meaning of yield from
Use Case: Coroutines for Discrete Event Simulation About Discrete Event Simulations
The Taxi Fleet Simulation
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
Threading and Multiprocessing Alternatives
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
Smarter Clients for Better Concurrency
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
Essential Attributes and Functions for Attribute Handling Special Attributes that Affect Attribute Handling
Built-In Functions for Attribute Handling
Special Methods for Attribute Handling
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__
Overwriting a Descriptor in the Class
Descriptor docstring and Overriding Deletion
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)
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
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.