~/talk

Hear no evil, see no evil, patch no evil: Or, how to monkey-patch safely.

Talkat PyCon AU 2016 · 2016-08-12..08-16· [python, software-architecture]
slides:none on file

Claims that the wrapt library fixes decorator and monkey‑patching pitfalls by preserving introspection, honoring the descriptor protocol and offering a C-backed fast path; demonstrates a synchronized universal decorator, transparent object proxy for per‑instance overrides, transient patches for tests, and a post-import hook system plus an auto-wrapped bootstrap (via setuptools entry points and a .pth hack) to apply patches before modules are used — code exists, is used for instrumentation, and the library works in production.

AI-written summary · about

  1. 0:00Intro
  2. 1:18Typical decorator
  3. 2:38Complicated details removed ....
  4. 3:23Basic decorator.
  5. 3:57Universal decorator.
  6. 5:18Synchronise function calls.
  7. 6:05Methods of classes as well.
  8. 6:22Synchronise block of code.
  9. 7:53Before decorators.
  10. 9:10Why monkey patch?
  11. 10:21Monkey patching with wrapt.
  12. 10:45Don't patch it yourself.
  13. 11:46Avoiding imports.
  14. 13:06Mock alternative.
  15. 14:11Transparent object proxy.
  16. 15:46Import from module.
  17. 18:19Post import hooks (PEP 369).
  18. 20:02The autowrapt package.
  19. 21:02Patch to time functions.
  20. 22:01Enabling patches.
  21. 25:48Reasons to use wrapt.
~/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.