Professional Documents
Culture Documents
Part VII. Exceptions and Tools: Xxiv - Table of Contents
Part VII. Exceptions and Tools: Xxiv - Table of Contents
795
Static Methods in 2.6 and 3.0 796
Static Method Alternatives 798
Using Static and Class Methods 799
Counting Instances with Static Methods 800
Counting Instances with Class Methods 802
Decorators and Metaclasses: Part 1 804
Function Decorator Basics 804
A First Function Decorator Example 805
Class Decorators and Metaclasses 807
For More Details 808
Class Gotchas 808
Changing Class Attributes Can Have Side Effects 808
Changing Mutable Class Attributes Can Have Side Effects, Too 810
Multiple Inheritance: Order Matters 811
Methods, Classes, and Nested Scopes 812
Delegation-Based Classes in 3.0: __getattr__ and built-ins 814
“Overwrapping-itis” 814
Chapter Summary 815
Test Your Knowledge: Quiz 815
Test Your Knowledge: Answers 815
Test Your Knowledge: Part VI Exercises 816
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1139