Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Object-oriented Python

You're reading from   Mastering Object-oriented Python If you want to master object-oriented Python programming this book is a must-have. With 750 code samples and a relaxed tutorial, it's a seamless route to programming Python.

Arrow left icon
Product type Paperback
Published in Apr 2014
Publisher Packt
ISBN-13 9781783280971
Length 634 pages
Edition Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Steven F. Lott Steven F. Lott
Author Profile Icon Steven F. Lott
Steven F. Lott
Arrow right icon
View More author details
Toc

Table of Contents (26) Chapters Close

Mastering Object-oriented Python
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Some Preliminaries
1. The __init__() Method 2. Integrating Seamlessly with Python Basic Special Methods FREE CHAPTER 3. Attribute Access, Properties, and Descriptors 4. The ABCs of Consistent Design 5. Using Callables and Contexts 6. Creating Containers and Collections 7. Creating Numbers 8. Decorators and Mixins – Cross-cutting Aspects 9. Serializing and Saving – JSON, YAML, Pickle, CSV, and XML 10. Storing and Retrieving Objects via Shelve 11. Storing and Retrieving Objects via SQLite 12. Transmitting and Sharing Objects 13. Configuration Files and Persistence 14. The Logging and Warning Modules 15. Designing for Testability 16. Coping With the Command Line 17. The Module and Package Design 18. Quality and Documentation Index

Index

A

  • abc module
    • about / The abc module
  • abstract base class (ABC)
    • about / The __new__() method and metaclasses, Abstract base classes
    • features / Abstract base classes
    • using / Abstract base classes
    • of collection / ABCs of collections
  • access layer
    • designing, for shelve / Designing an access layer for shelve
    • demonstration script, writing / Writing a demonstration script
    • designing, for SQLite / Designing an access layer for SQLite
  • ACID properties
    • about / The ACID properties, SQL transactions and the ACID properties, The REST protocol and ACID
  • additional operators
    • special methods, implementing / Implementing other special methods
  • advanced logging
    • automatic tail buffer, building / Building an automatic tail buffer
    • logging messages, sending to remote process / Sending logging messages to a remote process
    • queue overrun, preventing / Preventing queue overrun
  • ALTER statement
    • about / Schema evolution
  • AOP
    • about / Aspect-oriented programming
  • AOP, features
    • decorator / Aspect-oriented programming
    • mixin / Aspect-oriented programming
  • Apache httpd / Implementing a REST server – WSGI and mod_wsgi, Creating a simple REST application and server
  • append() method
    • about / Choosing eager versus lazy calculation
  • application
    • behaviors / Using the warnings module
  • application code
    • organizing, into src directory / Organizing code into src, bin, and test
    • organizing, into bin directory / Organizing code into src, bin, and test
    • organizing, into test directory / Organizing code into src, bin, and test
  • application configuration
    • design patterns / Application configuration design patterns
    • via object construction / Configuring via object construction
    • design patterns, global property map / Creating a top-level main() function
    • design patterns, object construction / Creating a top-level main() function
  • application data
    • processing, with SQL / Processing application data with SQL
  • application processing
    • about / Designing an access layer for shelve
  • application tier
    • application processing / Designing an access layer for shelve
    • problem domain data model / Designing an access layer for shelve
  • argparse
    • used, for parsing command line / Parsing the command line with argparse
  • arguments, command line
    • about / Arguments and options
  • arithmetic operator
    • special method / The arithmetic operator's special methods
    • binary operator / The arithmetic operator's special methods
    • unary operator / The arithmetic operator's special methods
  • atomicity
    • about / The ACID properties
  • attribute
    • processing / Basic attribute processing
    • creating, with __init__() method / Attributes and the __init__() method
    • differentiating, with property / Creating properties
    • eagerly computed attribute / Eagerly computed attributes
  • attribute access
    • about /
    • __setattr__() method / Using special methods for attribute access
    • __getattr__() method / Using special methods for attribute access
    • __delattr__() method / Using special methods for attribute access
    • __dir__() method / Using special methods for attribute access
  • attribute descriptor
    • about / Creating descriptors
  • attribute values, testing
    • black box perspective / Creating simple unit tests
    • white box perspective / Creating simple unit tests
  • auditability / Aspect-oriented programming
  • audit log
    • creating / Creating audit and security logs
  • automated application testing
    • about / Defining and isolating units for testing
  • automated performance testing
    • about / Defining and isolating units for testing, Automated integration or performance testing
  • automated unit testing
    • about / Defining and isolating units for testing
    • dependencies, minimizing / Minimizing the dependencies
    • simple unit tests, creating / Creating simple unit tests
    • test suite, creating / Creating a test suite
    • test cases, including / Including edge and corner cases
    • dependencies, mocking / Mocking dependencies for testing
    • dependencies, integrating / Mocking dependencies for testing
    • mocks, using / Using more mocks to test more behaviors
  • automatic tail buffer
    • building / Building an automatic tail buffer

B

  • bag
    • about / Using the standard library extensions
  • base class object
    • about / The base class object __init__() method
  • before image design pattern / Multiple layers of REST services
  • binary arithmetic operator
    • about / The arithmetic operator's special methods
    • defining / Defining FixedPoint binary arithmetic operators
  • binary tree set
    • about / Demonstrating the binary tree set
  • bin directory
    • application code, organizing into / Organizing code into src, bin, and test
  • black box testing
    • about / Creating simple unit tests
    • reference link / Creating simple unit tests
  • Blackjack
    • about / About casino Blackjack
    • overview / About casino Blackjack
    • game mechanics / Playing the game
    • player strategies / Blackjack player strategies
    • simulating, with object design / Object design for simulating Blackjack
    • additional class, defining / Some additional class definitions
    • new features, designing / Programming In The Large
    • new features, packaging / Programming In The Large
    • command classes, designing / Designing command classes
    • command classes, design issues / Designing command classes
    • analysis command subclass, adding / Adding the analysis command subclass
    • more features, adding / Adding and packaging more features into an application
    • more features, packaging / Adding and packaging more features into an application
    • higher-level command, designing / Designing a higher-level composite command
    • composite command, designing / Designing a higher-level composite command
  • BLOB
    • about / Mapping Python objects to SQLite BLOB columns
  • block of text, RST markup / Blocks of text
  • blog
    • rendering, into RST / Rendering a blog and posts
  • built-in decorator
    • using / Using built-in decorators
    • @staticmethod decorator / Using built-in decorators
    • @property decorator / Using built-in decorators
    • @classmethod decorator / Using built-in decorators

C

  • @classmethod decorator
    • about / Using built-in decorators
  • caching
    • using / Using memoization or caching
  • callable API
    • about / Aiming for simplicity using the callable API
    • complexities / Complexities and the callable API
  • callable object / Callables
    • creating / Designing with ABC callables
    • performance, improving / Improving performance
    • memoization, using / Using memoization or caching
    • callable API / Aiming for simplicity using the callable API
    • design considerations / Callable design considerations and trade-offs
    • using, for WSGI application / Using Callable classes for WSGI applications
    • RESTful object identifier, designing / Designing RESTful object identifiers
    • multilayered REST server / Multiple layers of REST services
    • roulette server, creating / Creating the roulette server
    • roulette client, creating / Creating the roulette client
  • callables
    • about /
    • creating / Callables
  • card() factory / Mocking dependencies for testing
  • Card class / Mocking dependencies for testing
  • ChainMap
    • about / The ChainMap use case
    • using, for overrides / Using ChainMap for defaults and overrides
    • using, for defaults / Using ChainMap for defaults and overrides
  • circular reference
    • with __del__() method / Circular references and garbage collection, Circular references and the weakref module
  • class
    • about / Class and meaning, Understanding persistence, class, state, and representation
    • constructing / Constructing the class
    • design principles / Some class design principles
    • method function, adding / Adding method functions to a class
    • defining, for persistence / Defining classes to support persistence
    • blog, rendering / Rendering a blog and posts
    • designing, for pickle processing / Designing a class for reliable pickle processing
    • designing, with simple key / Designing a class with a simple key
    • designing, for container / Designing classes for containers or collections
    • versus module / Module versus class
  • class-level logger
    • creating / Creating a shared class-level logger
  • class decorator
    • creating / Creating a class decorator
  • class definition
    • about / Understanding persistence, class, state, and representation
  • class docstring
    • writing / Writing class and method function docstrings
  • class objects
    • using / Simplicity using mapping and class objects
  • clone method
    • about / Multi-strategy __init__()
  • close() method
    • about / The __del__() and close() methods
  • coarse granularity / Generating surrogate keys for objects
  • collection
    • wrapping / Wrapping a collection class
    • extending / Extending a collection class
    • inventing / More requirements and another design
    • creating / Containers and collections, Creating new kinds of collections
    • abstract base class (ABC) / ABCs of collections
    • special methods, examples / Examples of special methods
    • Extend design strategy / Creating new kinds of collections
    • Wrap design strategy / Creating new kinds of collections
    • Invent design strategy / Creating new kinds of collections
    • sequence, defining / Defining a new kind of sequence
    • mapping, creating / Creating a new kind of mapping
    • set, creating / Creating a new kind of set
  • collection objects
    • about / The __repr__() and __str__() methods
  • collections
    • about /
  • columns
    • about / The SQL data model – rows and tables
  • command-line options
    • and environment variables, integrating / Integrating command-line options and environment variables
    • environment variables, overriding with / Integrating command-line options and environment variables
  • command line
    • about / The OS interface and the command line
    • arguments / Arguments and options
    • options / Arguments and options
    • parsing, with argparse / Parsing the command line with argparse
    • defining, patterns / Parsing the command line with argparse
    • simple on-off option, defining / A simple on/off option
    • option, defining with argument / An option with an argument
    • positional argument, defining / Positional arguments
    • other arguments, defining / All other arguments
    • --version display and exit option / --version display and exit
    • --help display and exit option / --help display and exit
  • Common Log Format / Managing contexts and the with statement
  • comparison operator
    • implementing / Implementing FixedPoint comparison operators
  • comparison operators
    • about / The comparison operator methods
    • special methods / The comparison operator methods
    • defining, considerations / Designing comparisons
    • defining / Designing comparisons
    • implementing, for same class objects / Implementation of comparison for objects of the same class
    • implementing, for mixed class objects / Implementation of comparison for objects of mixed classes
    • mixed class comparison, performing / Hard totals, soft totals, and polymorphism
    • mixed class comparison example / A mixed class comparison example
  • complex composite object
    • about / Complex composite objects
    • initialization / Complete composite object initialization
  • composite command
    • additional design patterns / Additional composite command design patterns
  • composite key
    • about / Designing keys for our objects
  • computability_theory
    • URL, for articles / ABCs of numbers
  • conceptual model
    • about / SQL databases, persistence, and objects
  • conditional script module
    • about / Some module design patterns
  • configuration, Gotcha / Configuration gotcha
  • configuration, logging
    • about / Configuring the loggers
  • configuration file
    • hierarchy / Implementing a configuration hierarchy
  • configuration files
    • use cases / Configuration file use cases
    • representation / Representation, persistence, state, and usability
    • persistence / Representation, persistence, state, and usability
    • state / Representation, persistence, state, and usability
    • usability / Representation, persistence, state, and usability
    • hierarchy / Implementing a configuration hierarchy
    • storing, in INI files / Storing the configuration in the INI files
    • storing, in PY files / Storing the configuration in PY files
    • storing, in JSON/YAML files / Storing the configuration in JSON or YAML files
    • storing, in property files / Storing the configuration in property files
    • storing, in XML files / Storing the configuration in XML files – PLIST and others
    • incorporating, with environment variables / Providing more configurable defaults
    • overriding, with environment variables / Overriding configuration file settings with environment variables
    • environment variables, overriding with / Overriding environment variables with the configuration files
  • connect() function
    • about / The SQL data model – rows and tables
  • consistency
    • about / The ACID properties
  • constructor
    • about / Extending the YAML representation
  • container
    • about / Simple composite objects
    • creating / Containers and collections
    • handling, in CSV / Handling containers and complex classes
  • Container class / ABCs of collections
  • context
    • about / Contexts and context managers
    • managing / Managing contexts and the with statement
    • defining, by with statement / Managing contexts and the with statement
    • decimal context, using / Using the decimal context
    • other contexts / Other contexts
  • context manager
    • about / Contexts and context managers, Managing contexts and the with statement
    • creating / Context manager as a factory
    • cleaning up / Cleaning up in a context manager
    • design considerations / Context manager design considerations and trade-offs
  • context manager mixin class
    • using / Using the context manager mixin class
  • contexts
    • about /
  • Counter
    • about / The counter collection
  • cross-cutting concern
    • about / Aspect-oriented programming
    • wiki reference / Aspect-oriented programming
    • examples / Aspect-oriented programming
  • cross-references
    • providing, with RST markup / More sophisticated markup techniques
    • implicit references / More sophisticated markup techniques
    • explicit references / More sophisticated markup techniques
    • inter-document references / More sophisticated markup techniques
    • creating, in Sphinx / Creating the Sphinx cross-references
  • CRUD operations
    • designing, for shelvable objects / Designing CRUD operations for complex objects
    • via DML statements / CRUD processing via SQL DML statements
    • implementing, via REST / Implementing CRUD operations via REST
  • CSV
    • dumping with / Dumping and loading with CSV
    • loading with / Dumping and loading with CSV
    • simple sequence, dumping to / Dumping simple sequences to CSV
    • simple sequence, loading from / Loading simple sequences from CSV
    • container, handling / Handling containers and complex classes
    • complex class, handling / Handling containers and complex classes
  • CSV file
    • multiple row type, loading / Dumping and loading multiple row types in a CSV file
    • multiple row type, dumping / Dumping and loading multiple row types in a CSV file
    • joined rows, dumping / Dumping and loading joined rows in a CSV file
    • joined rows, loading / Dumping and loading joined rows in a CSV file
  • CSV rows
    • filtering, with iterator / Filtering CSV rows with an iterator
  • CSV writer
    • creating / Dumping simple sequences to CSV
  • customized XML configuration files
    • about / Customized XML configuration files

D

  • database
    • setup/teardown, using with / Using setup and teardown with databases
  • data descriptor
    • about / Creating descriptors
    • using / Using a data descriptor
  • data modeling, SQL database
    • conceptual model / SQL databases, persistence, and objects
    • logical model / SQL databases, persistence, and objects
    • physical model / SQL databases, persistence, and objects
  • data tier, feature
    • access / Designing an access layer for shelve
    • persistence / Designing an access layer for shelve
  • date string
    • standardizing / Standardizing the date string
  • DCL
    • about / The SQL data model – rows and tables
  • DDL
    • about / The SQL data model – rows and tables
  • debugging log
    • creating / Creating a debugging log
  • decimal context
    • using / Using the decimal context
  • declarative base class
    • about / Designing ORM-friendly classes
  • decorator
    • used, for constructing function / Constructing the functions
    • about / Aspect-oriented programming
    • built-in decorator / Using built-in decorators
    • standard library decorator, using / Using standard library decorators
    • parameterizing / Parameterizing a decorator
    • using, for security / Using decorators for security
  • decorator function
    • about / Writing a simple function decorator
    • logger, creating / Creating separate loggers
  • defaultdict subclass
    • about / The defaultdict subclass
  • def statement
    • about / Constructing the functions
    • used, for constructing function / Constructing the functions
  • delegating
    • about / Wrapping a list and delegating
  • deleter property
    • about / Setter and deleter properties
  • DELETE statement
    • about / CRUD processing via SQL DML statements
  • demonstration script
    • writing, for access layer / Writing a demonstration script
  • dependencies, automated unit testing
    • minimizing / Minimizing the dependencies
    • mocking / Mocking dependencies for testing
    • integrating / Mocking dependencies for testing
  • deque class
    • about / The deque class
  • descriptor
    • about / Creating descriptors
    • creating / Creating descriptors
    • nondata descriptor / Creating descriptors
    • data descriptor / Creating descriptors
    • nondata descriptor, using / Using a nondata descriptor
    • data descriptor, using / Using a data descriptor
  • descriptor, design pattern
    • owner class / Creating descriptors
    • attribute descriptor / Creating descriptors
  • Descriptor.__delete__( self, instance ) / Creating descriptors
  • Descriptor.__get__( self, instance, owner ) / Creating descriptors
  • Descriptor.__set__( self, instance, value ) / Creating descriptors
  • descriptor object
    • about / Creating descriptors
  • design patterns, application configuration
    • global property map / Application configuration design patterns
    • object construction / Application configuration design patterns
  • design patterns, module
    • pure library module / Some module design patterns
    • main script module / Some module design patterns
    • conditional script module / Some module design patterns
  • Divide and Conquer design strategy / Improving performance
  • DML
    • about / The SQL data model – rows and tables
  • DML statements
    • used, for CRUD operations / CRUD processing via SQL DML statements
  • doc directory / Testing – unittest and doctest
  • docstring
    • about / Docstrings – RST markup and documentation tools
    • RST markup / Docstrings – RST markup and documentation tools
    • documentation tool / Docstrings – RST markup and documentation tools
    • writing, for help() function / Writing docstrings for the help() function
  • docstrings
    • writing, best practices / Writing effective docstrings
    • writing, for files / Writing effective docstrings
    • writing, for classes / Writing effective docstrings
    • writing, for functions / Writing effective docstrings
  • doctest
    • about / Testing – unittest and doctest
    • used, for defining test cases / Using doctest to define test cases
    • and unittest, combining / Combining doctest and unittest
  • documentation
    • producing, pydoc used / Using pydoc for documentation
    • creating, with RST markup / Better output via the RST markup
    • producing, Sphinx used / Using Sphinx to produce the documentation
    • writing, for software quality / Writing the documentation
  • documentation tool
    • about / Docstrings – RST markup and documentation tools
  • Document Object Model (DOM) / Dumping and loading with XML
  • Document Type Definition (DTD) / Dumping and loading with XML
  • docutils
    • URL / Better output via the RST markup
  • Dont Repeat Yourself (DRY) principle / Implementing __init__() in each subclass
  • doubling down
    • about / Playing the game
  • duck typing
    • about / Initialization with type validation
  • dump
    • about / Common Python terminologies
  • dump(object, file) method / Common Python terminologies
  • dumping
    • with JSON / Dumping and loading with JSON
    • with YAML / Dumping and loading with YAML
    • with pickle / Dumping and loading with pickle
    • with CSV / Dumping and loading with CSV
  • dumps(object) method / Common Python terminologies
  • durability
    • about / The ACID properties

E

  • eager calculation
    • about / Creating properties
    • versus lazy calculation, selecting / Choosing eager versus lazy calculation
  • eagerly computed attribute
    • about / Eagerly computed attributes
  • eagerly computed property
    • about / Eagerly computed properties
  • elif sequence
    • about / Simplicity and consistency using elif sequences
  • encapsulation
    • about / Initialization, encapsulation, and privacy
  • encode function
    • refactoring / Refactoring the encode function
  • environment variables
    • and command-line options, integrating / Integrating command-line options and environment variables
    • overriding, with command-line options / Integrating command-line options and environment variables
    • configuration files, incorporating with / Providing more configurable defaults
    • configuration files, overriding with / Overriding configuration file settings with environment variables
    • overriding, with configuration files / Overriding environment variables with the configuration files
    • with None value / Making the configuration aware of the None values
  • epydoc
    • about / Docstrings – RST markup and documentation tools
  • equality comparison, tiers
    • Same Hash Value / Deciding what to hash
    • Compare As Equal / Deciding what to hash
    • Same IDD / Deciding what to hash
  • eval() function
    • about / The security and the eval() issue
  • eval() variants
    • used, for handling literals / Handling more literals via the eval() variants
  • Evil Genius Programmer (EGP)
    • about / The security and the eval() issue
  • Exact Match Principle / Using doctest to define test cases
  • exception handling / Handling exceptions
  • exec() function
    • used, for application configuration / Using Python with exec() for the configuration
    • benefits / Why is exec() a nonproblem?
  • executable script file
    • creating / Creating an executable script file
  • explicit checking / Implementation of comparison for objects of the same class
  • explicit references / More sophisticated markup techniques
  • extend() method
    • about / Choosing eager versus lazy calculation

F

  • Facade
    • about / Some design rationale
  • Facade design pattern / Simple composite objects
  • factory function
    • used, for leveraging __init__() method / Leveraging __init__() via a factory function
    • vague else / Faulty factory design and the vague else clause
    • elif sequence / Simplicity and consistency using elif sequences
    • mapping / Simplicity using mapping and class objects
    • class objects, using / Simplicity using mapping and class objects
  • file-level docstrings
    • writing / Writing file-level docstrings, including modules and packages
    • API details, writing with RST markup / Writing API details in RST markup
    • method function docstring, writing / Writing class and method function docstrings
    • class docstring, writing / Writing class and method function docstrings
    • function docstring, writing / Writing function docstrings
  • filesystem
    • about / Filesystem and network considerations
  • fine granularity / Generating surrogate keys for objects
  • First Normal Form / Dumping simple sequences to CSV
  • FixedPoint class
    • creating / Creating a numeric class
    • initialization / Defining FixedPoint initialization
    • binary arithmetic operator, defining / Defining FixedPoint binary arithmetic operators
    • unary arithmetic operator, defining / Defining FixedPoint unary arithmetic operators
    • reflected operator, implementing / Implementing FixedPoint reflected operators
    • comparison operator, implementing / Implementing FixedPoint comparison operators
  • flattened JSON configuration
    • using / Using flattened JSON configurations
  • Flyweight design pattern
    • about / Stateless objects without __init__(), Metaclass example 2 – self-reference
  • foreign key / Designing classes for containers or collections
    • used, for referring shelvable object / Referring to objects via foreign keys
    • designing / Designing primary and foreign database keys
  • format() method
    • about / The __repr__() and __str__() methods
  • formatting options, YAML representation
    • explicit_start / Formatting YAML data on a file
    • explicit_end / Formatting YAML data on a file
    • version / Formatting YAML data on a file
    • tags / Formatting YAML data on a file
    • canonical / Formatting YAML data on a file
    • indent / Formatting YAML data on a file
    • width / Formatting YAML data on a file
    • allow_unicode / Formatting YAML data on a file
    • line_break / Formatting YAML data on a file
  • function
    • constructing, with def statement / Constructing the functions
    • constructing, with decorator / Constructing the functions
  • function docstring
    • writing / Writing function docstrings
  • functools
    • using, for memoization / Using functools for memoization
  • Fundamental Law of Hash (FLH) / Deciding what to hash

G

  • garbage collection
    • about / Circular references and garbage collection
  • global property map
    • about / Application configuration design patterns
    / Creating a top-level main() function
  • Gotcha
    • configuration / Configuration gotcha
  • granularity / Designing classes for containers or collections

H

  • --help display and exit option / --help display and exit
  • handlers
    • defining, for multiple destination / Defining handlers for multiple destinations
  • hard total
    • about / Hard totals, soft totals, and polymorphism
  • hash
    • considerations / Deciding what to hash
  • Hashable class / ABCs of collections
  • help() function / Initialization, encapsulation, and privacy
    • docstring, writing for / Writing docstrings for the help() function
  • help output
    • customizing / Customizing the help output
  • HTTP
    • about / Using HTTP and REST to transmit objects
    • used, for transmitting objects / Using HTTP and REST to transmit objects

I

  • IDE
    • common question / The IDE question
  • immutable object
    • about / The __hash__() method, Deciding what to hash
    • definition, inheriting / Inheriting definitions for immutable objects
    • definition, overriding / Overriding definitions for immutable objects
    • initializing, __new__() method used / The __new__() method and immutable objects
    • creating, with __slots__ / Creating immutable objects with __slots__
    • creating, as tuple subclass / Creating immutable objects as a tuple subclass
  • impedance mismatch / Dumping and loading with CSV
  • implementation document
    • writing, with Sphinx / Writing the implementation document
  • implicit checking / Implementation of comparison for objects of the same class
  • implicit references / More sophisticated markup techniques
  • implicit superclass
    • about / The implicit superclass – object
  • in-place operator
    • optimizing / Optimization with the in-place operators
  • index
    • creating / Creating indexes to improve efficiency
    • top-level indices, creating / Creating top-level indices
    • maintenance aspect / Adding yet more index maintenance
    • used, for improving SQLite performance / Improving performance with indices, Improving performance with indices
  • INI files
    • reference link / Storing the configuration in the INI files
    • configuration files, storing in / Storing the configuration in the INI files
  • initialization, complex composite object / Complete composite object initialization
  • initialization, FixedPoint class / Defining FixedPoint initialization
  • insert() method
    • about / Choosing eager versus lazy calculation
  • INSERT statement
    • about / CRUD processing via SQL DML statements
  • installation, module / Installing Python modules
  • inter-document references / More sophisticated markup techniques
  • isolation
    • about / The ACID properties
  • isolation level
    • about / SQL transactions and the ACID properties
    • None mode / SQL transactions and the ACID properties
    • autocommit mode / SQL transactions and the ACID properties
    • DEFERRED mode / SQL transactions and the ACID properties
    • IMMEDIATE mode / SQL transactions and the ACID properties
    • EXCLUSIVE mode / SQL transactions and the ACID properties
  • Iterable class / ABCs of collections
  • iterator
    • about / The iterator abstraction
    • used, for filtering CSV rows / Filtering CSV rows with an iterator
  • iterators
    • about /
    • creating, with __iter__() method / Creating iterators with __iter__()

J

  • Jinja2
    • URL / Rendering a blog and posts
  • JSON
    • about / Dumping and loading with JSON
    • URL / Dumping and loading with JSON
    • loading with / Dumping and loading with JSON
    • dumping with / Dumping and loading with JSON
    • supporting, in class / Supporting JSON in our classes
    • eval() function / The security and the eval() issue
    • security / The security and the eval() issue
    • encode function, refactoring / Refactoring the encode function
    • date string, standardizing / Standardizing the date string
  • JSON/YAML files
    • configuration files, storing in / Storing the configuration in JSON or YAML files
    • flattened JSON configuration, using / Using flattened JSON configurations
    • YAML configuration, loading / Loading a YAML configuration
  • JSON decoding
    • customizing / Customizing JSON decoding
  • JSON encoding
    • customizing / Customizing JSON encoding
  • JSON file
    • writing / Writing JSON to a file
  • JSON representation
    • drawbacks / Dumping and loading with JSON

K

  • keys
    • designing, for shelvable object / Designing keys for our objects
    • composite key / Designing keys for our objects
    • surrogate key / Designing keys for our objects

L

  • lambda / Designing with ABC callables
  • lazy calculation
    • about / Creating properties
    • versus eager calculation, selecting / Choosing eager versus lazy calculation
  • Least Recently Used (LRU) / Using functools for memoization
  • Liskov Substitution Principle
    • about / Base classes and polymorphism
  • list
    • wrapping / Wrapping a list and delegating
  • literals
    • handling, via eval() variants / Handling more literals via the eval() variants
  • literate programming
    • about / Literate programming
    • URL / Literate programming
    • creating, goals / Use cases for literate programming
    • use cases / Use cases for literate programming
  • literate programming tool
    • working with / Working with a literate programming tool
  • load
    • about / Common Python terminologies
  • load(file) method / Common Python terminologies
  • loading
    • with JSON / Dumping and loading with JSON
    • with YAML / Dumping and loading with YAML
    • with pickle / Dumping and loading with pickle
    • with CSV / Dumping and loading with CSV
  • loads(string) method / Common Python terminologies
  • logger
    • creating, for decorator function / Creating separate loggers
  • loggers, use cases
    • module names / Naming the loggers
    • object instances / Naming the loggers
    • class names / Naming the loggers
    • function names / Naming the loggers
  • logging / Aspect-oriented programming
    • creating / Creating a basic log
    • shared class-level logger, creating / Creating a shared class-level logger
    • configuring / Configuring the loggers
    • starting up / Starting up and shutting down the logging system
    • shutting down / Starting up and shutting down the logging system
    • loggers, naming / Naming the loggers
    • logger level, extending / Extending the logger levels
    • handlers, defining for multiple destination / Defining handlers for multiple destinations
    • propagation rules, managing / Managing the propagation rules
    • for errors/control / Specializing logging for control, debug, audit, and security
    • for debugging / Specializing logging for control, debug, audit, and security
    • for audit / Specializing logging for control, debug, audit, and security
    • for security / Specializing logging for control, debug, audit, and security
    • debugging log, creating / Creating a debugging log
    • audit log, creating / Creating audit and security logs
    • security log, creating / Creating audit and security logs
    • advanced logging / Advanced logging – the last few messages and network destinations
  • logging messages
    • sending, to remote process / Sending logging messages to a remote process
  • logical model
    • about / SQL databases, persistence, and objects
  • login_required decorator / Using decorators for security
  • long-running application
    • designing / Designing long-running applications
    • robust requirement / Designing long-running applications
    • auditable requirement / Designing long-running applications
    • debuggable requirement / Designing long-running applications
    • configurable requirement / Designing long-running applications
    • controllable requirement / Designing long-running applications

M

  • main script module
    • about / Some module design patterns
    • designing / Designing a main script and the __main__ module
    • executable script file, creating / Creating an executable script file
    • __main__ module, creating / Creating a __main__ module
    • programming, in complex application / Programming in the large
  • manifest constant
    • creating, __init__() method used / Using __init__() to create manifest constants
  • Man In The Middle attack
    • about / The security and the eval() issue
  • manual mapping
    • about / SQL databases, persistence, and objects
  • Many-to-many relationship
    • about / Designing primary and foreign database keys
  • Many-to-One relationship
    • about / Designing primary and foreign database keys
  • mapping
    • using / Simplicity using mapping and class objects
    • two parallel mapping / Two parallel mappings
    • performing, on two-tuple / Mapping to a tuple of values
    • partial() function / The partial function solution
    • fluent API / Fluent APIs for factories
    • creating / Creating a new kind of mapping
    • common strategies / SQL databases, persistence, and objects
  • Martingale betting system / Complexities and the callable API
  • memento() method function / Adding method functions to a class
  • memento design pattern / Multiple layers of REST services
  • memoization
    • using / Using memoization or caching
    • functools, using / Using functools for memoization
  • message queue
    • used, for transmitting objects / Using a message queue to transmit objects
    • processes, defining / Defining processes
    • building / Building queues and supplying data
    • data, supplying / Building queues and supplying data
  • metaclass
    • about / The __new__() method and metaclasses
    • usage / The __new__() method and metaclasses
    • creating, with ordered attributes / Metaclass example 1 – ordered attributes
    • creating, with self reference / Metaclass example 2 – self-reference
  • method function
    • adding, to class / Adding method functions to a class
  • method function decorator
    • creating / Creating a method function decorator
  • method function docstring
    • writing / Writing class and method function docstrings
  • Method Resolution Order (MRO)
    • about / Constructing the class
  • mixin
    • about / Defining the __enter__() and __exit__() methods, Aspect-oriented programming
  • mocks
    • using, for automated unit testing / Using more mocks to test more behaviors
  • mode
    • about / The counter collection
  • module
    • about / Designing a module
    • designing / Designing a module
    • design patterns / Some module design patterns
    • versus class / Module versus class
    • organization / The expected content of a module
    • installing / Installing Python modules
  • module-package hybrid
    • designing / Designing a module-package hybrid
  • module item
    • about / Whole module versus module items
    • versus whole module / Whole module versus module items
  • multi-strategy __init__() method
    • about / Multi-strategy __init__()
    • initialization / More complex initialization alternatives
    • static method, initialization / Initializing static methods
  • multilayered REST server
    • creating / Multiple layers of REST services
  • multiset
    • about / Using the standard library extensions
  • mutable object
    • about / Deciding what to hash
    • definition, overriding / Overriding definitions for mutable objects
  • myproject directory / Testing – unittest and doctest

N

  • namedtuple() function
    • about / The namedtuple() function
  • nested configuration contexts
    • managing / Managing nested configuration contexts
  • network consideration
    • about / Filesystem and network considerations
  • nginx / Implementing a REST server – WSGI and mod_wsgi
  • no mapping
    • about / SQL databases, persistence, and objects
  • non-collection objects
    • about / The __repr__() and __str__() methods
  • non-CRUD operations
    • implementing, via REST / Implementing non-CRUD operations
  • nondata descriptor
    • about / Creating descriptors
    • using / Using a nondata descriptor
  • numbers
    • about / ABCs of numbers
    • creating / Numbers
    • abstract class, defining / ABCs of numbers
    • numeric type conversion / ABCs of numbers
    • numeric type selection / Deciding which types to use
    • reflected operator / The method resolution and the reflected operator concept
    • method resolution / The method resolution and the reflected operator concept
    • design considerations / Design considerations and trade-offs
  • number_theory
    • URL, for articles / ABCs of numbers
  • numeric hash
    • computing / Computing a numeric hash

O

  • object
    • relating, to class / Class and meaning
    • dumping, with XML / Dumping and loading with XML
    • loading, with XML / Dumping and loading with XML
    • dumping, string template used / Dumping objects using string templates
    • dumping, xml.etree.ElementTree used / Dumping objects with xml.etree.ElementTree
    • mapping, to SQLite BLOB columns / Mapping Python objects to SQLite BLOB columns
    • mapping, to SQL database rows / Mapping Python objects to database rows manually
    • access layer, designing for SQLite / Designing an access layer for SQLite
    • container relationships, implementing / Implementing container relationships
    • manipulating, with ORM layer / Manipulating objects with the ORM layer
  • object-relational management (ORM)
    • about /
  • Object-Relational Mapping
    • about / SQL databases, persistence, and objects
  • object construction
    • about / Application configuration design patterns, Creating a top-level main() function
    • for application configuration / Configuring via object construction
  • object design
    • for simulating Blackjack / Object design for simulating Blackjack
  • One-to-many relationship
    • about / Designing primary and foreign database keys
  • One-to-one relationship
    • about / Designing primary and foreign database keys
  • options, command line
    • about / Arguments and options
    • defining, with argument / An option with an argument
  • OrderedDict collection
    • about / The OrderedDict collection
  • organization, module / The expected content of a module
  • ORM layer
    • about / SQL databases, persistence, and objects
    • adding / Adding an ORM layer
    • class, designing / Designing ORM-friendly classes
    • schema, building / Building the schema with the ORM layer
    • object, manipulating / Manipulating objects with the ORM layer
  • OS API
    • about / The OS interface and the command line
  • OS resources
    • setup/teardown, using with / Using setup and teardown with OS resources
  • other abstract base class (ABC)
    • iterator / The iterator abstraction
    • context manager / Contexts and context managers
    • context / Contexts and context managers
  • owner class
    • about / Creating descriptors
  • owner instance
    • about / Creating descriptors

P

  • .pyc file / Designing a module
  • .py file / Designing a module
  • .pyo file / Designing a module
  • @property decorator
    • about / Creating properties, Using built-in decorators
  • package
    • designing / Designing a package
    • about / Designing a package
    • module-package hybrid, designing / Designing a module-package hybrid
    • designing, with alternate implementation / Designing a package with alternate implementations
  • partial() function
    • about / The partial function solution
  • PEP 8
    • URL / The expected content of a module
  • PEP 3333
    • URL / Implementing a REST server – WSGI and mod_wsgi
  • permission_required decorator / Using decorators for security
  • persistence
    • about / Understanding persistence, class, state, and representation
    • class definition / Defining classes to support persistence
  • persistent object
    • analyzing / Analyzing persistent object use cases
    • ACID properties / The ACID properties
  • physical model
    • about / SQL databases, persistence, and objects
  • pickle
    • dumping with / Dumping and loading with pickle
    • loading with / Dumping and loading with pickle
    • security / Security and the global issue
    • global issue / Security and the global issue
  • pickle processing
    • class, designing for / Designing a class for reliable pickle processing
  • pip
    • URL / Using Sphinx to produce the documentation
  • polymorphism
    • about / Hard totals, soft totals, and polymorphism, Base classes and polymorphism
  • pop() method / Extending a collection class
    • about / Choosing eager versus lazy calculation
  • positional argument, command line
    • defining / Positional arguments
  • Pretty Poor Polymorphism
    • about / Hard totals, soft totals, and polymorphism, Base classes and polymorphism
  • primary key
    • about / Referring to objects via foreign keys
    • designing / Designing primary and foreign database keys
  • print() function
    • about / The __repr__() and __str__() methods
  • privacy
    • about / Initialization, encapsulation, and privacy
  • problem domain data model
    • about / Designing an access layer for shelve
  • processes, message queue
    • defining / Defining processes
  • propagation rules, logging
    • managing / Managing the propagation rules
  • property
    • about / Creating properties
    • creating / Creating properties
    • differentiating, with attribute / Creating properties
    • design pattern / Creating properties
    • eagerly computed property / Eagerly computed properties
    • deleter property / Setter and deleter properties
    • setter property / Setter and deleter properties
  • property() function
    • about / Creating properties
  • property, design pattern
    • eager calculation / Creating properties
    • lazy calculation / Creating properties
  • property files
    • configuration files, storing in / Storing the configuration in property files
    • reference link / Storing the configuration in property files
    • parsing / Parsing a properties file
    • using / Using a properties file
  • pure library module
    • about / Some module design patterns
    • whole module / Some module design patterns
    • item collection / Some module design patterns
  • pydoc
    • used, for producing documentation / Using pydoc for documentation
  • PY files
    • configuration files, storing in / Storing the configuration in PY files
    • application configuration, via class definition / Configuration via class definitions
    • application configuration, via SimpleNamespace / Configuration via SimpleNamespace
    • application configuration, with exec() function / Using Python with exec() for the configuration
  • PyPI
    • URL / Implementing REST with a web application framework
  • Python
    • special method / About special method names
    • used, for integrating,with other applications / Integrating with other applications
  • Python Enhancement Proposal (PEP)
    • about / CRUD processing via SQL DML statements
    • URL / CRUD processing via SQL DML statements
  • Python Package Index
    • URL / Parsing a properties file
  • Python web component
    • reference link / Implementing REST with a web application framework
  • Python web frameworks
    • reference link / Implementing REST with a web application framework
  • Python web servers
    • reference link / Implementing a REST server – WSGI and mod_wsgi

Q

  • querying
    • about / Searching, scanning, and querying
  • queue overrun
    • preventing / Preventing queue overrun

R

  • random.Random.shuffle() method / Mocking dependencies for testing
  • Read-execute-print loop (REPL) / The OS interface and the command line
  • read uncommitted mode
    • about / SQL transactions and the ACID properties
  • reference count
    • about / The reference count and destruction
  • reflected operator
    • about / The method resolution and the reflected operator concept
    • implementing / Implementing FixedPoint reflected operators
  • regular expression (RE) / The __format__() method
  • Regular Expression (RE) / Parsing a properties file
  • relationships
    • implementing, in explicit way / Designing primary and foreign database keys
    • implementing, in implicit way / Designing primary and foreign database keys
  • relationships, design patterns
    • One-to-many / Designing primary and foreign database keys
    • Many-to-many / Designing primary and foreign database keys
    • One-to-one / Designing primary and foreign database keys
  • Remote Procedure Call (RPC)
    • about / Implementing non-CRUD operations
  • remove() method
    • about / Choosing eager versus lazy calculation
  • REPLACE statement
    • about / CRUD processing via SQL DML statements
  • representation
    • about / Understanding persistence, class, state, and representation
    • creating, in YAML / Extending the YAML representation
    • selecting / Choosing a representation – JSON, XML, or YAML
  • Representation State Transfer (REST) /
  • representer
    • about / Extending the YAML representation
  • Request for Comments (RFC)
    • about / Using HTTP and REST to transmit objects
  • REST
    • used, for transmitting objects / Using HTTP and REST to transmit objects
    • CRUD operations, implementing / Implementing CRUD operations via REST
    • non-CRUD operations, implementing / Implementing non-CRUD operations
    • ACID properties / The REST protocol and ACID
    • representation, selecting / Choosing a representation – JSON, XML, or YAML
    • implementing, with web application framework / Implementing REST with a web application framework
  • REST client
    • implementing / Implementing a REST client
  • RESTful object identifier
    • designing / Designing RESTful object identifiers
  • REST server
    • implementing, WSGI used / Implementing a REST server – WSGI and mod_wsgi
    • creating / Creating a simple REST application and server
    • REST client, implementing / Implementing a REST client
    • demonstrating / Demonstrating and unit testing the RESTful services
    • unit testing / Demonstrating and unit testing the RESTful services
  • reverse() method
    • about / Choosing eager versus lazy calculation
  • roulette client
    • creating / Creating the roulette client
  • roulette server
    • creating / Creating the roulette server
  • round() function / Designing more useful rounding
  • rows
    • about / The SQL data model – rows and tables
    • querying, with SELECT statement / Querying rows with the SQL SELECT statement
    • object, mapping to / Mapping Python objects to database rows manually
  • RST directives
    • about / RST directives
  • RST inline markup
    • about / The RST inline markup
  • RST markup
    • about / Docstrings – RST markup and documentation tools
    • used, for creating documentation / Better output via the RST markup
    • block of text / Blocks of text
    • inline markup / The RST inline markup
    • directives / RST directives
    • learning / Learning RST
    • used, for writing API details / Writing API details in RST markup
    • used, for providing cross-references to document / More sophisticated markup techniques

S

  • @staticmethod decorator
    • about / Using built-in decorators
  • safe_load() method
    • about / Security and safe loading
  • scanning
    • about / Searching, scanning, and querying
  • schema
    • building, with ORM layer / Building the schema with the ORM layer
  • schema evolution
    • about / Schema evolution, Schema evolution
  • Schema Migration Problem / Understanding persistence, class, state, and representation
  • searching
    • about / Searching, scanning, and querying
  • secure REST service
    • creating / Creating a secure REST service
    • WSGI Authentication application / The WSGI Authentication application
  • Secure Sockets Layer (SSL)
    • about / Using HTTP and REST to transmit objects
  • security / Aspect-oriented programming
    • with decorator / Using decorators for security
    • with user_passes_test decorator / Using decorators for security
    • with login_required decorator / Using decorators for security
    • with permission_required decorator / Using decorators for security
  • security, JSON / The security and the eval() issue
  • security, pickle / Security and the global issue
  • security, YAML / Security and safe loading
  • security log
    • creating / Creating audit and security logs
  • SELECT statement
    • about / CRUD processing via SQL DML statements
    • used, for querying rows / Querying rows with the SQL SELECT statement
  • sentinel object / Defining processes
  • sequence
    • defining / Defining a new kind of sequence
    • statistical list / A statistical list
    • eager versus lazy calculation, selecting / Choosing eager versus lazy calculation
    • slices / Working with __getitem__(), __setitem__(), __delitem__(), and slices
    • __getitem__() method / Working with __getitem__(), __setitem__(), __delitem__(), and slices
    • __setitem__() method / Working with __getitem__(), __setitem__(), __delitem__(), and slices
    • __delitem__() method / Working with __getitem__(), __setitem__(), __delitem__(), and slices
    • __delitem__() method, implementing / Implementing __getitem__(), __setitem__(), and __delitem__()
    • __setitem__() method, implementing / Implementing __getitem__(), __setitem__(), and __delitem__()
    • __getitem__() method, implementing / Implementing __getitem__(), __setitem__(), and __delitem__()
    • list, wrapping / Wrapping a list and delegating
    • delegating / Wrapping a list and delegating
    • iterators, creating with __iter__() method / Creating iterators with __iter__()
  • serialization
    • purpose /
  • set
    • creating / Creating a new kind of set
    • TreeNode class / Some design rationale
    • tree class / Some design rationale
    • tree class, defining / Defining the Tree class
    • TreeNode class, defining / Defining the TreeNode class
    • binary tree set / Demonstrating the binary tree set
  • setter property
    • about / Setter and deleter properties
  • setUp() method / Using setup and teardown
  • setup/teardown
    • about / Using setup and teardown
    • using, with OS resources / Using setup and teardown with OS resources
    • using, with database / Using setup and teardown with databases
  • setUpClass() method / Using setup and teardown
  • setUpModule() function / Using setup and teardown
  • setuptools
    • URL / Using Sphinx to produce the documentation
  • shelvable object
    • designing / Designing shelvable objects
    • keys, designing / Designing keys for our objects
    • surrogate key, generating / Generating surrogate keys for objects
    • coarse granularity / Generating surrogate keys for objects
    • fine granularity / Generating surrogate keys for objects
    • class, designing with key / Designing a class with a simple key
    • class, designing for container / Designing classes for containers or collections
    • referring, with foreign key / Referring to objects via foreign keys
    • CRUD operations, designing / Designing CRUD operations for complex objects
  • shelve
    • creating / Creating a shelf
    • access layer, designing / Designing an access layer for shelve
  • simple composite object
    • about / Simple composite objects
    • collection, designing / Simple composite objects
    • collection, wrapping / Wrapping a collection class
    • collection, extending / Extending a collection class
    • collection, inventing / More requirements and another design
  • simple key
    • used, for designing class / Designing a class with a simple key
  • SimpleNamespace object
    • creating / Configuration via SimpleNamespace
  • simple on-off option, command line
    • defining / A simple on/off option
  • simple unit tests
    • creating / Creating simple unit tests
  • Singleton design pattern / Application configuration design patterns
  • singleton object
    • about / Module versus class
  • Sized class / ABCs of collections
  • slices
    • about / Working with __getitem__(), __setitem__(), __delitem__(), and slices
  • soft total
    • about / Hard totals, soft totals, and polymorphism
  • software quality
    • documentation, writing for / Writing the documentation
    • reference link / Writing the documentation
  • special method, arithmetic operator / The arithmetic operator's special methods
  • special method, Python
    • about / About special method names
  • special methods, additional operators
    • implementing / Implementing other special methods
  • Sphinx
    • about / Docstrings – RST markup and documentation tools
    • used, for producing documentation / Using Sphinx to produce the documentation
    • quickstart, using / Using the Sphinx quickstart
    • documentation, writing / Writing the Sphinx documentation
    • 4+1 views, filling for documentation / Filling in the 4+1 views for documentation
    • implementation document, writing / Writing the implementation document
    • cross-references, creating / Creating the Sphinx cross-references
    • files, refactoring into directories / Refactoring Sphinx files into directories
  • Sphinx quickstart
    • using / Using the Sphinx quickstart
  • SQL
    • used, for processing application data / Processing application data with SQL
    • class-like processing, implementing / Implementing class-like processing in pure SQL
  • SQLAlchemy
    • URL / Adding an ORM layer
    • about / Adding an ORM layer
    • posts, querying / Querying post objects given a tag string
  • SQL database
    • data modeling / SQL databases, persistence, and objects
    • SQL data model / The SQL data model – rows and tables
    • CRUD operations, via DML statements / CRUD processing via SQL DML statements
    • rows, querying with SELECT statement / Querying rows with the SQL SELECT statement
    • SQL transaction / SQL transactions and the ACID properties
    • ACID properties / SQL transactions and the ACID properties
    • primary key, designing / Designing primary and foreign database keys
    • foreign key, designing / Designing primary and foreign database keys
    • schema evolution / Schema evolution
  • SQL data model
    • tables / The SQL data model – rows and tables
    • rows / The SQL data model – rows and tables
    • columns / The SQL data model – rows and tables
  • SQLite
    • URL / The SQL data model – rows and tables
    • access layer, designing / Designing an access layer for SQLite
    • performance, improving with index / Improving performance with indices, Improving performance with indices
  • SQLite BLOB column
    • object, mapping to / Mapping Python objects to SQLite BLOB columns
  • SQL language
    • DDL / The SQL data model – rows and tables
    • DML / The SQL data model – rows and tables
    • DCL / The SQL data model – rows and tables
  • SQL statements
    • INSERT statement / CRUD processing via SQL DML statements
    • SELECT statement / CRUD processing via SQL DML statements
    • UPDATE statement / CRUD processing via SQL DML statements
    • REPLACE statement / CRUD processing via SQL DML statements
    • DELETE statement / CRUD processing via SQL DML statements
  • SQL transaction
    • about / SQL transactions and the ACID properties
  • src directory
    • application code, organizing into / Organizing code into src, bin, and test
  • standard library collection
    • using / Using the standard library extensions
    • namedtuple() function / Using the standard library extensions, The namedtuple() function
    • deque class / Using the standard library extensions, The deque class
    • ChainMap / Using the standard library extensions, The ChainMap use case
    • OrderedDict collection / Using the standard library extensions, The OrderedDict collection
    • defaultdict subclass / Using the standard library extensions, The defaultdict subclass
    • Counter / Using the standard library extensions, The counter collection
    • heapq module / Using the standard library extensions
    • array module / Using the standard library extensions
  • standard library decorator
    • using / Using standard library decorators
  • standard library mixin class
    • using / Using standard library mixin classes
    • context manager mixin class, using / Using the context manager mixin class
    • feature, turning off / Turning off a class feature
  • state
    • about / Understanding persistence, class, state, and representation
  • State design pattern / Using __init__() to create manifest constants
  • stateless object
    • without __init__() method / Stateless objects without __init__()
  • static method
    • initialization / Initializing static methods
  • Strategy class / Designing an access layer for SQLite
  • Strategy design pattern / Using __init__() to create manifest constants
  • Strategy object
    • about / Stateless objects without __init__()
  • string template
    • used, for dumping object / Dumping objects using string templates
  • strong reference
    • about / Circular references and the weakref module
  • subclass
    • __init__() method, implementing / Implementing __init__() in each subclass
  • superclass
    • __init__() method, implementing / Implementing __init__() in a superclass
  • surrogate key
    • about / Handling containers and complex classes, Designing keys for our objects
    • generating, for shelvable object / Generating surrogate keys for objects

T

  • tables
    • about / The SQL data model – rows and tables
  • tearDown() method / Using setup and teardown
  • tearDownClass() method / Using setup and teardown
  • tearDownModule() function / Using setup and teardown
  • technology spike
    • creating, for unit testing / Unit testing and technology spikes
  • template string
    • format specifications / Non collection __str__() and __repr__()
  • TestCase class
    • hierarchy / The TestCase class hierarchy
    • common setUp() method / The TestCase class hierarchy
    • common tearDown() method / The TestCase class hierarchy
    • common results checking method / The TestCase class hierarchy
    • externally defined expected results, using / Using externally defined expected results
  • test cases
    • including, for automated unit testing / Including edge and corner cases
    • about / Including edge and corner cases
    • corner cases / Including edge and corner cases
    • edge cases / Including edge and corner cases
    • defining, doctest used / Using doctest to define test cases
    • complete test package, creating / Creating a more complete test package
  • test directory / Testing – unittest and doctest
    • application code, organizing into / Organizing code into src, bin, and test
  • testing
    • about / Defining and isolating units for testing
    • automated performance testing / Defining and isolating units for testing
    • automated unit testing / Defining and isolating units for testing
    • automated application testing / Defining and isolating units for testing
  • testing scenarios
    • no integration / Using setup and teardown
    • internal integration / Using setup and teardown
    • external integration / Using setup and teardown
  • test suite
    • creating / Creating a test suite
  • TeXLive
    • URL / Learning RST
  • timeit module
    • about / Performance – the timeit module
  • top-level indices
    • creating / Creating top-level indices
  • top-level main() function
    • creating / Creating a top-level main() function
    • naming / Creating a top-level main() function
    • DRY, ensuring for application configuration / Ensuring DRY for the configuration
    • nested configuration contexts, managing / Managing nested configuration contexts
  • tree class
    • about / Some design rationale
    • defining / Defining the Tree class
  • TreeNode class
    • about / Some design rationale
    • defining / Defining the TreeNode class
  • trunc() function / Designing more useful rounding
  • two parallel mapping
    • about / Two parallel mappings
  • type() function
    • about / The __new__() method and metaclasses
  • type validation
    • about / Initialization with type validation

U

  • unary arithmetic operator
    • about / The arithmetic operator's special methods
    • defining / Defining FixedPoint unary arithmetic operators
  • Uniform Resource Identifier (URI)
    • about / Using HTTP and REST to transmit objects
  • unittest
    • about / Testing – unittest and doctest
    • and doctest, combining / Combining doctest and unittest
    • setup/teardown, using / Using setup and teardown
  • unit testing
    • about / Testing – unittest and doctest
    • unittest / Testing – unittest and doctest
    • doctest / Testing – unittest and doctest
    • technology spike, creating / Unit testing and technology spikes
  • Universally Unique ID (UUID)
    • about / The OrderedDict collection
  • UPDATE statement
    • about / CRUD processing via SQL DML statements
  • user_passes_test decorator / Using decorators for security

V

  • --version display and exit option / --version display and exit
  • 4+1 views, Sphinx
    • reference link / Writing the Sphinx documentation
    • filling, for documentation / Filling in the 4+1 views for documentation
  • vague else
    • about / Faulty factory design and the vague else clause

W

  • warnings module
    • using / Using the warnings module
    • API changes, displaying / Showing API changes with a warning
    • configuration problem, displaying / Showing configuration problems with a warning
    • software problem, displaying / Showing possible software problems with a warning
  • weak reference
    • about / Circular references and the weakref module
  • WHERE clause
    • about / CRUD processing via SQL DML statements
  • white box testing
    • about / Creating simple unit tests
    • reference link / Creating simple unit tests
  • whole module
    • about / Whole module versus module items
    • versus module item / Whole module versus module items
  • with statement
    • used, for defining context / Managing contexts and the with statement
  • Wrapper
    • about / Some design rationale
  • writeback
    • about / The writeback alternative to index updates
    • schema evolution / Schema evolution
  • writerow() method / Dumping simple sequences to CSV
  • WSGI
    • URL / Implementing a REST server – WSGI and mod_wsgi
    • about / Implementing a REST server – WSGI and mod_wsgi
    • used, for implementing REST server / Implementing a REST server – WSGI and mod_wsgi
  • WSGI application
    • callable object, using for / Using Callable classes for WSGI applications
  • WSGI Authentication application
    • creating / The WSGI Authentication application

X

  • XML
    • object, loading with / Dumping and loading with XML
    • object, dumping with / Dumping and loading with XML
    • object dumping, string template used / Dumping objects using string templates
    • object dumping, xml.etree.ElementTree used / Dumping objects with xml.etree.ElementTree
  • xml.etree.ElementTree
    • used, for dumping object / Dumping objects with xml.etree.ElementTree
  • XML document
    • loading / Loading XML documents
  • XML files
    • configuration files, storing in / Storing the configuration in XML files – PLIST and others
    • customized XML configuration files / Customized XML configuration files
  • XML Schema Definition (XSD) / Dumping and loading with XML

Y

  • YAML
    • about / Dumping and loading with YAML
    • loading with / Dumping and loading with YAML
    • dumping with / Dumping and loading with YAML
    • URL / Dumping and loading with YAML
    • benefits / Dumping and loading with YAML
    • representation, creating / Extending the YAML representation
    • security / Security and safe loading
    • safe loading / Security and safe loading
  • YAML configuration
    • loading / Loading a YAML configuration
  • YAML data
    • formatting, on file / Formatting YAML data on a file
lock icon The rest of the chapter is locked
arrow left Previous Section
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime
Banner background image