A Taxonomy of Decorators: A-E
summary
Covers a concrete taxonomy: argument-changing decorators (example: click options change a function signature), return-value decorators (TurboGears expose → JSON), binding/descriptor decorators (SQLAlchemy hybrid_property and a true-instance-method example), control-flow decorators (retry, LRU cache/memoization, even an infinite-retry demo), descriptive decorators (pytest marks, Flask app.route registration) and execution-level transforms (Numba-style source rewrite), with code patterns, pitfalls, and small runnable examples. Watch if needing practical rules and tradeoffs.
AI-written summary · about
chapters (19)
- 0:00Introduction
- 1:48Overview
- 3:02Syntax
- 4:06decorators with arguments
- 5:41decorators as classes
- 6:28A Taxonomy
- 8:41Return Value
- 9:28Composable Result
- 10:00Binding
- 12:46Control Flow
- 13:31Retry
- 14:12Infinite retry
- 15:54The mark
- 16:35Routing via decorators
- 17:15Example
- 19:00Number
- 19:30Function
- 20:58Wrapping
- 22:13Other examples
related talks
29mOn the Use and Misuse of Decorators
29mHow Decorators Function
21mEnhancing Decorators with Type Annotations: Techniques and Best Practices
02h 15mAll about decorators
02h 21mIntroduction to Decorators: Power Up Your Python Code
38mDecorators demystified
01mTutorial Sneak Peak: "All about decorators"
02h 32mIntroduction to Decorators: Power UP Your Python Code
