B

backslash (\), Other Ways to Code Strings, Escape Sequences Represent Special CharactersRaw Strings Suppress Escapes, Statement rule special cases, Statement Delimiters: Lines and Continuations
escape sequences and, Other Ways to Code Strings, Escape Sequences Represent Special CharactersRaw Strings Suppress Escapes
multiline statements and, Statement rule special cases, Statement Delimiters: Lines and Continuations
backtracking, exception handlers and, Exception Roles
base classes, Attribute Inheritance Search
BaseException class, Exception Objects, Built-in Exception Classes
__bases__ attribute, The World’s Simplest Python Class, Instance Versus Class Attributes, Namespace Dictionaries: Review, Listing attributes per object in class trees, Python’s inheritance algorithm: The simple version
about, The World’s Simplest Python Class, Namespace Dictionaries: Review
inheritance and, Instance Versus Class Attributes, Listing attributes per object in class trees, Python’s inheritance algorithm: The simple version
BDFL (Benevolent Dictator for Life), It’s Free
benchmarking, Timing Iteration AlternativesRoom for improvement: Setup, Benchmark Module and Script: timeitRoom for improvement: Setup, More Fun with Benchmarks, Other Benchmarking Topics: pystones, Test Your Knowledge: Quiz
pystone.py program, Other Benchmarking Topics: pystones
quiz questions and answers, Test Your Knowledge: Quiz
timeit module, Benchmark Module and Script: timeitRoom for improvement: Setup
timing iteration, Timing Iteration AlternativesRoom for improvement: Setup
usage examples, More Fun with Benchmarks
Benevolent Dictator for Life (BDFL), It’s Free
big-endian format, Handling the BOM in 3.XDropping the BOM in Python
bin built-in function, Numeric Literals, Character code conversions
binary files, Frozen Binaries, Frozen Binary Executables, Unicode Strings, Binary Bytes Files, Binary Bytes Files, Escape Sequences Represent Special Characters, Text and Binary Files: The Short Story, Storing Packed Binary Data: struct, Text and Binary FilesText and Binary Files, Using Text and Binary Files, Text and Binary Modes in 2.X and 3.X, The struct Binary Data ModuleThe struct Binary Data Module
about, Unicode Strings, Binary Bytes Files, Text and Binary FilesText and Binary Files, Using Text and Binary Files
escape sequences and, Escape Sequences Represent Special Characters
frozen executables, Frozen Binaries, Frozen Binary Executables
storing data, Storing Packed Binary Data: struct
struct module and, The struct Binary Data ModuleThe struct Binary Data Module
text files and, Binary Bytes Files
version considerations, Text and Binary Files: The Short Story, Text and Binary Modes in 2.X and 3.X
binary formatting, Extra features: Special-case “batteries” versus general techniques
binary notation, Numeric Literals, Hex, Octal, Binary: Literals and ConversionsHex, Octal, Binary: Literals and Conversions
binary operator methods, Right-Side and In-Place Uses: __radd__ and __iadd__In-Place Addition
bitwise operations, Python Expression Operators, Bitwise OperationsBitwise Operations
blank lines, Usage Notes: The Interactive Prompt, Entering multiline statements, Python Syntax Revisited
common usage mistakes, Usage Notes: The Interactive Prompt
statements and, Entering multiline statements, Python Syntax Revisited
block strings, Triple Quotes Code Multiline Block StringsTriple Quotes Code Multiline Block Strings
blocks of code, Block rule special case, Nesting Code Three Levels Deep, Block Delimiters: Indentation RulesAvoid mixing tabs and spaces: New error checking in 3.X, Block Delimiters: Indentation RulesAvoid mixing tabs and spaces: New error checking in 3.X, Block Delimiters: Indentation RulesAvoid mixing tabs and spaces: New error checking in 3.X, Loop Coding TechniquesGenerating Both Offsets and Items: enumerate
delimiting, Block Delimiters: Indentation RulesAvoid mixing tabs and spaces: New error checking in 3.X
indenting, Block Delimiters: Indentation RulesAvoid mixing tabs and spaces: New error checking in 3.X
loop coding techniques, Loop Coding TechniquesGenerating Both Offsets and Items: enumerate
nesting, Nesting Code Three Levels Deep, Block Delimiters: Indentation RulesAvoid mixing tabs and spaces: New error checking in 3.X
special case rules, Block rule special case
BOM (byte order marker), Text and Binary Files, Handling the BOM in 3.XDropping the BOM in Python
__bool__ method, Common Operator Overloading Methods, Boolean Tests: __bool__ and __len__Boolean Methods in Python 2.X
Booleans (bool type), Other Core Types, Booleans, The bool type, Truth Values and Boolean TestsTruth Values and Boolean Tests, The if/else Ternary Expression, Boolean Tests: __bool__ and __len__Boolean Methods in Python 2.X, Boolean Methods in Python 2.X
about, Other Core Types, The if/else Ternary Expression
operator overloading and, Boolean Tests: __bool__ and __len__Boolean Methods in Python 2.X
truth test and, Booleans, The bool type, Truth Values and Boolean TestsTruth Values and Boolean Tests
version considerations, Boolean Methods in Python 2.X
bound methods, Scopes: lambdas Can Be Nested Too, Methods Are Objects: Bound or UnboundOther callables, Static Methods in 2.X and 3.X
bounds checking for lists, Bounds Checking
branching in if statements, Multiway BranchingHandling larger actions
break statement, Python’s Statements, break, continue, pass, and the Loop else, break, Breaking Out of Multiple Nested Loops: “go to”
about, Python’s Statements, break, continue, pass, and the Loop else
nested loops and, break, Breaking Out of Multiple Nested Loops: “go to”
bsddb extension module, Exploring Shelves Interactively
built-in attributes, Other Ways to Combine Classes, Intercepting Built-in Operation AttributesDelegation-based managers revisited
built-in exception classes, Built-in Exception Classes, Built-in Exception Categories, Default Printing and StateDefault Printing and State
about, Built-in Exception Classes
built-in categories, Built-in Exception Categories
default printing and state, Default Printing and StateDefault Printing and State
built-in exceptions, User-Defined Exceptions, Example: Catching Built-in Exceptions
built-in object types, It’s Powerful, Why Use Built-in Types?, Python’s Core Data Types, Numbers, Strings, Lists, Dictionaries, Tuples, Files, General Type CategoriesMutable Types Can Be Changed in Place, Core Types Review and Summary, Core Types Review and Summary, Object Flexibility, References Versus CopiesReferences Versus Copies, Comparisons, Equality, and TruthPython 2.X and 3.X dictionary comparisons, Comparisons, Equality, and TruthPython 2.X and 3.X dictionary comparisons, Python’s Type HierarchiesOther Types in Python, Built-in Type GotchasImmutable Types Can’t Be Changed in Place, Assignment Creates References, Not Copies, Other Built-in Type IterablesOther Built-in Type Iterables, Generation in Built-in Types, Tools, and ClassesPreview: User-defined iterables in classes, Extending Built-in TypesExtending Types by Subclassing, New-Style Class Changes, Attribute Fetch for Built-ins Skips InstancesFor more details, Applying class decorators to built-in types, The built-ins special caseThe built-ins special case
about, It’s Powerful, Why Use Built-in Types?, Core Types Review and Summary
attribute fetches for, New-Style Class Changes, Attribute Fetch for Built-ins Skips InstancesFor more details
class decorators and, Applying class decorators to built-in types
common usage mistakes, Built-in Type GotchasImmutable Types Can’t Be Changed in Place
comparison operations, Comparisons, Equality, and TruthPython 2.X and 3.X dictionary comparisons
core data types, Python’s Core Data Types, Core Types Review and Summary
dictionaries, Dictionaries (see dictionaries)
equality and, Comparisons, Equality, and TruthPython 2.X and 3.X dictionary comparisons
extending, Extending Built-in TypesExtending Types by Subclassing
files, Files (see files)
general type categories, General Type CategoriesMutable Types Can Be Changed in Place
generation in, Generation in Built-in Types, Tools, and ClassesPreview: User-defined iterables in classes
iteration and, Other Built-in Type IterablesOther Built-in Type Iterables
lists, Lists (see lists)
metaclasses and, The built-ins special caseThe built-ins special case
numbers, Numbers (see numbers)
object flexibility, Object Flexibility
references versus copies, References Versus CopiesReferences Versus Copies, Assignment Creates References, Not Copies
strings, Strings (see strings)
tuples, Tuples (see tuples)
type hierarchies, Python’s Type HierarchiesOther Types in Python
built-in scope, Scope Details, Name Resolution: The LEGB Rule, The Built-in ScopeRedefining built-in names: For better or worse
about, Scope Details, The Built-in ScopeRedefining built-in names: For better or worse
LEGB rule and, Name Resolution: The LEGB Rule
__builtin__ module, Other Built-in Numeric Tools, Redefining built-in names: For better or worse
builtins module, Other Built-in Numeric Tools, The Built-in ScopeRedefining built-in names: For better or worse
byte code, Byte code compilationByte code compilation, Byte code compilation, Byte code compilation, The Python Virtual Machine (PVM), Byte Code Files: __pycache__ in Python 3.2+Byte Code File Models in Action, Optimized byte code files
about, Byte code compilationByte code compilation
modules and, Byte Code Files: __pycache__ in Python 3.2+Byte Code File Models in Action
optimizing, Optimized byte code files
PVM and, The Python Virtual Machine (PVM)
Python versions and, Byte code compilation
source changes and, Byte code compilation
byte order marker (BOM), Text and Binary Files, Handling the BOM in 3.XDropping the BOM in Python
bytearray string type, Immutability, Unicode Strings, Unicode: The Short Story, Changing Strings I, String Method Examples: Changing Strings II, String Changes in 3.X, Python’s String TypesWhy the different string types?, Using 3.X/2.6+ bytearray ObjectsPython 3.X String Types Summary
about, Unicode Strings, Unicode: The Short Story, String Changes in 3.X, Python’s String TypesWhy the different string types?, Using 3.X/2.6+ bytearray ObjectsPython 3.X String Types Summary
changing strings, Immutability, Changing Strings I, String Method Examples: Changing Strings II
bytes built-in function, Type Objects
bytes string type, Unicode Strings, Unicode: The Short Story, Text and Binary Files: The Short Story, Storing Native Python Objects: pickle, Python’s String TypesWhy the different string types?, Byte String Literals: Encoded Text, Using 3.X bytes Objects, Method Calls, Sequence Operations, Other Ways to Make bytes Objects, Mixing String Types, Type and Content Mismatches in 3.X, Test Your Knowledge: QuizTest Your Knowledge: Answers
about, Unicode Strings, Text and Binary Files: The Short Story, Python’s String TypesWhy the different string types?, Using 3.X bytes Objects
bytearray string type and, Unicode: The Short Story
encoded text, Byte String Literals: Encoded Text
making bytes objects, Other Ways to Make bytes Objects
method calls, Method Calls
mixing string types, Mixing String Types
pickle module and, Storing Native Python Objects: pickle
quiz questions and answers, Test Your Knowledge: QuizTest Your Knowledge: Answers
sequence operations, Sequence Operations
type and content mismatches, Type and Content Mismatches in 3.X