~/talk

Python Design Patterns

Talkat EuroPython 2011 · 2011-06-20..06-26· [python]
links:none on file
slides:none on file

Covers concrete Python patterns and tradeoffs with runnable examples: replaces hardwired time.sleep by inject time.sleep so a scheduler uses a fake clock for fast deterministic tests, shows how singleton breaks with subclassing and why shared-state singletons fail, contrasts factories vs dependency injection for unpredictable object counts, demonstrates safe use of monkeypatch for emergency and prefers explicit injection, explains callbacks/Hollywood, lazy imports, decorators and observers with practical caveats and when each approach actually simplifies testing and extension.

AI-written summary · about

  1. 0:00Intro
  2. 2:05A Pattern Example
  3. 3:19Solution: the Facade DP
  4. 5:32Facade is a Design Pattern
  5. 10:13Some Facade KUS
  6. 12:34Is Facade a "Pythonic" DP?
  7. 15:43Design Patterns
  8. 16:02Step back: what's a Pattern?
  9. 17:15A Pattern's problem(s)
  10. 18:05A Pattern's "solution(s)"
  11. 19:35Why bother w/Patterns?
  12. 22:34"Design" is a vague term...
  13. 23:20What's a "Pythonic" Pattern
  14. 27:54Python: hold or wrap?
  15. 31:58Creational Patterns
  16. 33:50Singleton ("Highlander")
  17. 35:56Monostate ("Borg")
  18. 37:24Creational DPs: "Flexibility"
  19. 41:34DI: why we want it
  20. 45:32Template Method vs DI
  21. 47:50TM-VS-DI issues
  22. 49:21Monkey-patching
  23. 51:30Dependency Injection
  24. 53:50DI design-choice details
  25. 56:10DI and factories
  26. 58:23The Callback Pattern
  27. 59:10The "Callback" concept
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.