Index
Symbols
- () (parentheses) in generator comprehensions, Comprehensions and Generators
- * syntax, Accepting and Passing Variable Arguments, Argument Unpacking
- *args, Accepting and Passing Variable Arguments
- := (assignment expression) operator, Generator Patterns and Scalable Composability
- @classmethod, Raising Exceptions, Alternative Constructors: The Simple Factory
- @property, Decorators, Properties
- [] operator, accessing list elements, The Iterator Protocol
A
- absolute value, finding number with greatest, Functions as Objects
- actual and expected values (in tests), Unit Tests and Simple Assertions
- antipatterns, The Most Diabolical Python Antipattern
- argparse, Spawning a Module
- argument unpacking, Argument Unpacking
- arguments
- argv, Spawning a Module
- “as” clause, renaming modules and items from modules, Antipattern Warning
- assertions, Unit Tests and Simple Assertions
- assignment expressions, Generator Patterns and Scalable Composability
- attrgetter, Key Functions in Python
- attributes, Properties
- automated tests, Automated Testing
C
- __call__ magic method, Implementing Class-Based Decorators
- callables, Functions as Objects, Implementing Class-Based Decorators
- callbacks, A Pythonic Refinement
- camel case names, Fixtures and Common Test Setup
- catch-and-release pattern (exceptions), Catching and Re-Raising
- class statements, Import Side Effects
- class-based decorators
- classes, Classes and Objects: Beyond the Basics
- classmethod decorator, Alternative Constructors: The Simple Factory
- command line, running Python on, Unit Tests and Simple Assertions
- community for readers of this book, Parting Words
- components, Spawning a Module
- comprehensions, Creating Collections with Comprehensions
- benefits of comprehensions, Creating Collections with Comprehensions
- chaining dependent for clauses, Multiple Sources and Filters
- dictionary, Dictionaries, Sets, and Tuples
- filtering elements with if clause, List Comprehensions
- formatting comprehensions, Formatting for Readability (and More)
- generator, Comprehensions and Generators
- list comprehensions, List Comprehensions
- multiple for and if clauses, Multiple Sources and Filters
- relationship between multiple if clauses, Multiple Filters
- set, Dictionaries, Sets, and Tuples
- tuple, Dictionaries, Sets, and Tuples
- constructors, alternative, in simple factory pattern, Alternative Constructors: The Simple Factory
- context processors, Generator Patterns and Scalable Composability
- coroutines, comparison with functions, Advancing next()
- critical log level, Log Levels
D
- DataFrame, Rebelliously Misusing Magic Methods
- DatagramHandler, Log Destinations: Handlers and Streams
- debug log level, Log Levels
- decorators, Decorators
- defining functions, Combining Positional and Keyword Arguments
- design patterns, The Most Diabolical Python Antipattern, Classes and Objects: Beyond the Basics
- destinations for log messages, Log Destinations: Handlers and Streams
- dict
- dictionaries
- dictionary comprehensions, Creating Collections with Comprehensions, Dictionaries, Sets, and Tuples
- diffs, more pinpointed, Import Syntax and Version Control
- doctest, What Is Test-Driven Development?
- domain-specific language (DSL), Rebelliously Misusing Magic Methods
- dunder, Magic Methods
- dynamic types, factory method pattern, Dynamic Type: The Factory Method Pattern
E
- EEXIST, Catching and Re-Raising
- errno, Catching and Re-Raising
- error log level, Log Levels
- error messages, better, Raising Exceptions
- errors, Exceptions and Errors
- except, Handling Exceptions
- exception() function (logging module), The Most Diabolical Python Antipattern
- exceptions, Exceptions and Errors
- asserting in tests, Asserting Exceptions
- basic idea of, The Basic Idea
- dictionary exceptions, Dictionary Exceptions
- finally blocks and, Finally Blocks
- flow control and, Exceptions for Flow Control
- handling, Handling Exceptions-Exceptions for Flow Control
- importing libraries and exceptions, Exceptions for Flow Control
- logging and exceptions, Exceptions for Flow Control
- most harmful antipattern in Python, The Most Diabolical Python Antipattern
- multiple except clauses, Finally Blocks
- as objects, Exceptions Are Objects-Exceptions Are Objects
- order of execution in try-except-finally, Finally Blocks
- raising exceptions, Raising Exceptions
- re-raising exceptions, Catching and Re-Raising
- expected and actual values (in tests), Unit Tests and Simple Assertions
F
- factory functions, Alternative Constructors: The Simple Factory
- factory method pattern, Dynamic Type: The Factory Method Pattern
- factory patterns, The Factory Patterns
- fanning in, Fanning In
- fanning out, Fanning Out
- FileExistsError, Exceptions Are Objects, Catching and Re-Raising
- FileHandler (in logging module), Log Destinations: Handlers and Streams, Log Destinations: Handlers and Streams
- filemode option (logging), Configuring the Basic Interface
- filename option (logging), Configuring the Basic Interface
- files
- filter function, Python Is Filled with Iterators
- filtering, Composable Interfaces
- filters, multiple, in comprehensions, Multiple Filters
- finally, Finally Blocks
- Flask web framework, Decorators, Decorators That Take Arguments
- flow, What Is Test-Driven Development?
- flow control, exceptions for, Exceptions for Flow Control-Exceptions for Flow Control
- for clauses, multiple, in comprehensions, Multiple Sources and Filters
- for keyword (in comprehensions), List Comprehensions
- for loops
- format option (logging), Configuring the Basic Interface
- formatters, Record Layout with Formatters
- formatting code for version control and code reviews, Formatting for Readability (and More)
- function objects, Functions as Objects
- function-based decorator, implementing as class-based decorators, Benefits of Class-Based Decorators
- functions, Advanced Functions
I
- if clauses
- import * antipattern, Antipattern Warning
- import statements, Import Syntax and Version Control
- ImportError, Exceptions for Flow Control
- imports, Module Organization
- in keyword (comprehensions), List Comprehensions
- IndexError, The Basic Idea, Spawning a Module
- info log level, Log Levels
- inheritance
- __init__ method, Alternative Constructors: The Simple Factory
- __init__.py file, Multifile Modules
- integration tests, What Is Test-Driven Development?
- itemgetter, Key Functions in Python
- iter(), Iteration in Python, The Iterator Protocol
- iterable, Iteration in Python, The Iterator Protocol, The Iterator Protocol
- iterables
- iteration, Scaling with Generators
- iterator protocol, The Iterator Protocol
- iterators, Iteration in Python, The Iterator Protocol
L
- lexicographic ordering, Functions as Objects
- Linux, Spawning a Module
- list comprehensions, Creating Collections with Comprehensions, List Comprehensions-List Comprehensions
- logging, Logging in Python
- basic interface to logging, Logging in Python
- configuring logging’s basic interface, Configuring the Basic Interface
- handlers for logging, Log Destinations: Handlers and Streams, Log Destinations: Handlers and Streams
- log levels, Log Levels, Why Do We Have Log Levels?
- log sinks, Log Destinations: Handlers and Streams
- logger objects, Logging in Python, Beyond Basic: Loggers
- logging to multiple destinations, Logging to Multiple Destinations
- parameters for log messages, Passing Arguments
- record layout with formatters, Record Layout with Formatters
- sinks for logging, Log Destinations: Handlers and Streams
- logging.exception() function, The Most Diabolical Python Antipattern
M
- magic methods, Iteration in Python, Magic Methods-Rebelliously Misusing Magic Methods
- main guard, Spawning a Module
- map function, Python Is Filled with Iterators
- mapping operations, Composable Interfaces
- max, Functions as Objects, Key Functions in Python
- merge conflicts in version control, Import Syntax and Version Control
- method objects, A Pythonic Refinement
- methodcaller, Key Functions in Python
- methods
- min, Key Functions in Python
- modules, Module Organization
P
- pandas, Rebelliously Misusing Magic Methods
- parameterized tests, Using Subtests
- PHPUnit, Automated Testing
- positional arguments, Variable Keyword Arguments
- process table, Spawning a Module
- properties
- property decorator, Properties
- protected, Property Patterns
- pub-sub design pattern, The Observer Pattern
- publisher, The Observer Pattern
- pytest, What Is Test-Driven Development?
R
- raising exceptions, Raising Exceptions
- range objects, Multiple Sources and Filters
- range(), Converting to a Generator Function, Python Is Filled with Iterators, Multiple Sources and Filters
- readability and comprehensions, Creating Collections with Comprehensions, Formatting for Readability (and More)
- records (logging), layout with formatters, Record Layout with Formatters
- refactoring, Properties and Refactoring, What Is Test-Driven Development?
- relationship between generator expressions and generator comprehensions, Comprehensions and Generators
- relative import, Multifile Modules
- __repr__ method, implementing on classes, Decorators for Classes
- repr(), Decorators for Classes, Magic Methods
- root logger, Beyond Basic: Loggers
- RotatingFileHandler, Log Destinations: Handlers and Streams
S
- scalability
- scalable composability, Text Lines to Dicts
- self argument, decorators and, Decorating Methods
- sentinel value, The Iterator Protocol
- sequence protocol, The Iterator Protocol
- Series object, Rebelliously Misusing Magic Methods
- set comprehensions, Dictionaries, Sets, and Tuples
- setters, Properties, Validation
- setUp (in unit tests), Fixtures and Common Test Setup
- side-effects of imports, Import Side Effects
- simple factory design pattern, Alternative Constructors: The Simple Factory
- singleton pattern, expressing using class decorators, Decorators for Classes
- SocketHandler, Log Destinations: Handlers and Streams
- sorted, Key Functions in Python
- source control management, Import Syntax and Version Control
- sources and sinks, Composable Interfaces
- stderr, logging to, Log Destinations: Handlers and Streams, Log Destinations: Handlers and Streams
- stdout, logging to, Log Destinations: Handlers and Streams
- StopIteration, Iteration in Python
- str(), Decorators for Classes, Magic Methods
- StreamHandler (in logging module), Log Destinations: Handlers and Streams
- submodules, Multifile Modules, Nested Submodule Structure
- subscribers, The Observer Pattern
- subtests, Using Subtests
- syntax, Variable Keyword Arguments
- sys.argv, Spawning a Module
- system under test (SUT), What Is Test-Driven Development?
T
- TDD (see test-driven development)
- tearDown (in unit tests), Fixtures and Common Test Setup
- test classes, Unit Tests and Simple Assertions
- test fixtures, Fixtures and Common Test Setup, Fixtures and Common Test Setup
- test-driven development (TDD), What Is Test-Driven Development?
- TestCase class, Unit Tests and Simple Assertions
- tests
- The Most Diabolical Python Antipattern (TMDPA), The Most Diabolical Python Antipattern
- try, Handling Exceptions
- tuples
- TypeError, The Basic Idea, Exceptions for Flow Control