B
- backslash (\), Other Ways to Code Strings, Escape Sequences Represent Special Characters–Raw Strings Suppress Escapes, Statement rule special cases, Statement Delimiters: Lines and Continuations
-
- escape sequences and, Other Ways to Code Strings, Escape Sequences Represent Special Characters–Raw 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 Alternatives–Room for improvement: Setup, Benchmark Module and Script: timeit–Room 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: timeit–Room for improvement: Setup
- timing iteration, Timing Iteration Alternatives–Room 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.X–Dropping 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 Files–Text and Binary Files, Using Text and Binary Files, Text and Binary Modes in 2.X and 3.X, The struct Binary Data Module–The struct Binary Data Module
-
- about, Unicode Strings, Binary Bytes Files, Text and Binary Files–Text 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 Module–The 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 Conversions–Hex, 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 Operations–Bitwise 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 Strings–Triple Quotes Code Multiline Block Strings
- blocks of code, Block rule special case, Nesting Code Three Levels Deep, Block Delimiters: Indentation Rules–Avoid mixing tabs and spaces: New error checking in 3.X, Block Delimiters: Indentation Rules–Avoid mixing tabs and spaces: New error checking in 3.X, Block Delimiters: Indentation Rules–Avoid mixing tabs and spaces: New error checking in 3.X, Loop Coding Techniques–Generating Both Offsets and Items: enumerate
-
- delimiting, Block Delimiters: Indentation Rules–Avoid mixing tabs and spaces: New error checking in 3.X
- indenting, Block Delimiters: Indentation Rules–Avoid mixing tabs and spaces: New error checking in 3.X
- loop coding techniques, Loop Coding Techniques–Generating Both Offsets and Items: enumerate
- nesting, Nesting Code Three Levels Deep, Block Delimiters: Indentation Rules–Avoid 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.X–Dropping 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 Tests–Truth 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 Tests–Truth 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 Unbound–Other callables, Static Methods in 2.X and 3.X
- bounds checking for lists, Bounds Checking
- branching in if statements, Multiway Branching–Handling 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 Attributes–Delegation-based managers revisited
- built-in exception classes, Built-in Exception Classes, Built-in Exception Categories, Default Printing and State–Default Printing and State
-
- about, Built-in Exception Classes
- built-in categories, Built-in Exception Categories
- default printing and state, Default Printing and State–Default 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 Categories–Mutable Types Can Be Changed in Place, Core Types Review and Summary, Core Types Review and Summary, Object Flexibility, References Versus Copies–References Versus Copies, Comparisons, Equality, and Truth–Python 2.X and 3.X dictionary comparisons, Comparisons, Equality, and Truth–Python 2.X and 3.X dictionary comparisons, Python’s Type Hierarchies–Other Types in Python, Built-in Type Gotchas–Immutable Types Can’t Be Changed in Place, Assignment Creates References, Not Copies, Other Built-in Type Iterables–Other Built-in Type Iterables, Generation in Built-in Types, Tools, and Classes–Preview: User-defined iterables in classes, Extending Built-in Types–Extending Types by Subclassing, New-Style Class Changes, Attribute Fetch for Built-ins Skips Instances–For more details, Applying class decorators to built-in types, The built-ins special case–The 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 Instances–For more details
- class decorators and, Applying class decorators to built-in types
- common usage mistakes, Built-in Type Gotchas–Immutable Types Can’t Be Changed in Place
- comparison operations, Comparisons, Equality, and Truth–Python 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 Truth–Python 2.X and 3.X dictionary comparisons
- extending, Extending Built-in Types–Extending Types by Subclassing
- files, Files (see files)
- general type categories, General Type Categories–Mutable Types Can Be Changed in Place
- generation in, Generation in Built-in Types, Tools, and Classes–Preview: User-defined iterables in classes
- iteration and, Other Built-in Type Iterables–Other Built-in Type Iterables
- lists, Lists (see lists)
- metaclasses and, The built-ins special case–The built-ins special case
- numbers, Numbers (see numbers)
- object flexibility, Object Flexibility
- references versus copies, References Versus Copies–References Versus Copies, Assignment Creates References, Not Copies
- strings, Strings (see strings)
- tuples, Tuples (see tuples)
- type hierarchies, Python’s Type Hierarchies–Other Types in Python
- built-in scope, Scope Details, Name Resolution: The LEGB Rule, The Built-in Scope–Redefining built-in names: For better or worse
-
- about, Scope Details, The Built-in Scope–Redefining 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 Scope–Redefining built-in names: For better or worse
- byte code, Byte code compilation–Byte 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 compilation–Byte 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.X–Dropping 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 Types–Why the different string types?, Using 3.X/2.6+ bytearray Objects–Python 3.X String Types Summary
-
- about, Unicode Strings, Unicode: The Short Story, String Changes in 3.X, Python’s String Types–Why the different string types?, Using 3.X/2.6+ bytearray Objects–Python 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 Types–Why 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: Quiz–Test Your Knowledge: Answers
-
- about, Unicode Strings, Text and Binary Files: The Short Story, Python’s String Types–Why 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: Quiz–Test Your Knowledge: Answers
- sequence operations, Sequence Operations
- type and content mismatches, Type and Content Mismatches in 3.X