G
- garbage collection, Nesting Revisited, Objects Are Garbage-Collected, Changing Strings I, Other Python scopes: Preview, Object Destruction: __del__–Destructor Usage Notes
-
- about, Nesting Revisited, Changing Strings I
- exception variables and, Other Python scopes: Preview
- objects and, Objects Are Garbage-Collected, Object Destruction: __del__–Destructor Usage Notes
- gc module, Objects Are Garbage-Collected
- __ge__ method, Common Operator Overloading Methods
- generators, Comprehensions, Iteration and Optimization, Multiple Versus Single Pass Iterators, Other Iteration Topics, Generator Functions and Expressions, Generator Functions: yield Versus return–Extended generator function protocol: send versus next, Iteration protocol integration, Iteration protocol integration, Why generator functions?, Extended generator function protocol: send versus next, Generator Expressions: Iterables Meet Comprehensions–Generator expressions versus filter, Generator Functions Versus Generator Expressions–Generator Functions Versus Generator Expressions, Generators Are Single-Iteration Objects–Generators Are Single-Iteration Objects, Generation in Built-in Types, Tools, and Classes–Preview: User-defined iterables in classes, Example: Generating Scrambled Sequences–Permutations: All possible combinations, Don’t Abuse Generators: EIBTI–On the other hand: Space and time, conciseness, expressiveness, Example: Emulating zip and map with Iteration Tools–Coding your own zip(...) and map(None, ...), Test Your Knowledge: Quiz, Classes versus generators, Listing attributes per object in class trees
-
- about, Comprehensions, Generator Functions and Expressions
- classes and, Generation in Built-in Types, Tools, and Classes–Preview: User-defined iterables in classes, Classes versus generators
- EIBTI acronym, Don’t Abuse Generators: EIBTI–On the other hand: Space and time, conciseness, expressiveness
- functions versus expressions, Generator Functions Versus Generator Expressions–Generator Functions Versus Generator Expressions
- generating scrambled sequences, Example: Generating Scrambled Sequences–Permutations: All possible combinations
- iterables versus comprehensions, Generator Expressions: Iterables Meet Comprehensions–Generator expressions versus filter
- iteration and, Iteration and Optimization, Multiple Versus Single Pass Iterators, Other Iteration Topics, Iteration protocol integration, Generators Are Single-Iteration Objects–Generators Are Single-Iteration Objects, Example: Emulating zip and map with Iteration Tools–Coding your own zip(...) and map(None, ...)
- multithreading and, Why generator functions?
- __next__ method, Iteration protocol integration
- quiz questions and answers, Test Your Knowledge: Quiz
- recursive calls, Listing attributes per object in class trees
- send method, Extended generator function protocol: send versus next
- yield versus return statement, Generator Functions: yield Versus return–Extended generator function protocol: send versus next
- __get__ method, Common Operator Overloading Methods, Other Attribute Management Tools, Descriptor method arguments, Using descriptors to decorate methods
-
- about, Common Operator Overloading Methods
- descriptors and, Other Attribute Management Tools, Using descriptors to decorate methods
- managing attributes, Descriptor method arguments
- getattr built-in function, Other Ways to Combine Classes, OOP and Delegation: “Wrapper” Proxy Objects
- __getattr__ method, Other Ways to Combine Classes, Common Operator Overloading Methods, Attribute Access: __getattr__ and __setattr__–Emulating Privacy for Instance Attributes: Part 1, OOP and Delegation: “Wrapper” Proxy Objects, Pseudoprivate Class Attributes, Attribute Fetch for Built-ins Skips Instances, Implications for attribute interception, Inserting Code to Run on Attribute Access, __getattr__ and __getattribute__–Delegation-based managers revisited, __getattr__ and __getattribute__ Compared, Intercepting Built-in Operation Attributes–Delegation-based managers revisited, Using __getattr__ to Validate–Using __getattr__ to Validate, Implementation, Tracing Object Interfaces–Applying class decorators to built-in types, Implementation alternatives: __getattribute__ inserts, call stack inspection–Implementation alternatives: __getattribute__ inserts, call stack inspection, Operator Overloading in Metaclass Methods
-
- about, Common Operator Overloading Methods, Attribute Access: __getattr__ and __setattr__–Emulating Privacy for Instance Attributes: Part 1, Inserting Code to Run on Attribute Access
- attribute fetches and, Other Ways to Combine Classes
- attribute interception and, Implications for attribute interception
- class decorators and, Implementation, Tracing Object Interfaces–Applying class decorators to built-in types
- emulating privacy, Pseudoprivate Class Attributes
- __getattribute__ method comparison, __getattr__ and __getattribute__ Compared
- implementation alternatives, Implementation alternatives: __getattribute__ inserts, call stack inspection–Implementation alternatives: __getattribute__ inserts, call stack inspection
- intercepting built-in operation attributes, Intercepting Built-in Operation Attributes–Delegation-based managers revisited
- managing attributes, __getattr__ and __getattribute__–Delegation-based managers revisited
- metaclasses and, Operator Overloading in Metaclass Methods
- new-style classes and, Attribute Fetch for Built-ins Skips Instances
- validating with, Using __getattr__ to Validate–Using __getattr__ to Validate
- wrapper classes and, OOP and Delegation: “Wrapper” Proxy Objects
- __getattribute__ method, More recursion examples, Other Ways to Combine Classes, Common Operator Overloading Methods, Other Attribute Management Tools, Attribute Fetch for Built-ins Skips Instances, __getattribute__ and Descriptors: Attribute Tools, Inserting Code to Run on Attribute Access, __getattr__ and __getattribute__–Delegation-based managers revisited, __getattr__ and __getattribute__ Compared, Intercepting Built-in Operation Attributes–Delegation-based managers revisited, Using __getattribute__ to Validate
-
- about, Common Operator Overloading Methods, Other Attribute Management Tools, __getattribute__ and Descriptors: Attribute Tools, Inserting Code to Run on Attribute Access
- attribute fetches and, Other Ways to Combine Classes
- __getattr__ method comparison, __getattr__ and __getattribute__ Compared
- intercepting built-in operation attributes, Intercepting Built-in Operation Attributes–Delegation-based managers revisited
- managing attributes, __getattr__ and __getattribute__–Delegation-based managers revisited
- new-style classes and, Attribute Fetch for Built-ins Skips Instances
- recursive looping and, More recursion examples
- validating with, Using __getattribute__ to Validate
- __getitem__ method, Other Iteration Topics, Preview: User-defined iterables in classes, Common Operator Overloading Methods, Indexing and Slicing: __getitem__ and __setitem__–But 3.X’s __index__ Is Not Indexing!, Index Iteration: __getitem__–Index Iteration: __getitem__, Membership: __contains__, __iter__, and __getitem__–Membership: __contains__, __iter__, and __getitem__
-
- about, Common Operator Overloading Methods, Indexing and Slicing: __getitem__ and __setitem__–But 3.X’s __index__ Is Not Indexing!
- index iteration and, Index Iteration: __getitem__–Index Iteration: __getitem__
- membership and, Membership: __contains__, __iter__, and __getitem__–Membership: __contains__, __iter__, and __getitem__
- user defined class and, Other Iteration Topics
- user defined iterables and, Preview: User-defined iterables in classes
- getopt module, Example: Dual Mode Code
- __getslice__ method, Slicing and Indexing in Python 2.X, The __cmp__ Method in Python 2.X
- global scope, Scope Details, Name Resolution: The LEGB Rule, State with Globals: A Single Copy Only, Simple Names: Global Unless Assigned
-
- about, Scope Details
- LEGB rule and, Name Resolution: The LEGB Rule, Simple Names: Global Unless Assigned
- state retention and, State with Globals: A Single Copy Only
- global statement, Python’s Statements, Coding Functions, Scope Details, The global Statement, nonlocal Basics
-
- about, Python’s Statements, Scope Details, The global Statement, nonlocal Basics
- coding functions, Coding Functions
- global variables, Program Design: Minimize Global Variables, Other Ways to Access Globals, Module Design Concepts
-
- alternatives for accessing, Other Ways to Access Globals
- minimizing, Program Design: Minimize Global Variables
- modules and, Module Design Concepts
- go to statements, Breaking Out of Multiple Nested Loops: “go to”
- Graphical User Interface (GUI), GUIs, Future Directions
- __gt__ method, Common Operator Overloading Methods, Comparisons: __lt__, __gt__, and Others
- GUI (Graphical User Interface), GUIs, Future Directions