[Python-Dev] Monkeypatching idioms -- elegant or ugly?

Stephen J. Turnbull stephen at xemacs.org
Tue Jan 15 21:43:33 CET 2008


Guido van Rossum writes:

 > I think it's useful to share these recipes,

But only to people who have demonstrated that they already know when,
why and how to monkeypatch on their own.  Lisp's `defadvice' plays a
starring role in a number of my nightmares.  Most recently, 15 minutes
ago.<wink>

Come to think of it, `defadvice' does have the advantage that it also
automatically monkeypatches the docstring to say "This function has
<class> advice", and with a little cooperation from the advisor can
also provide documentation of the changed semantics.




More information about the Python-Dev mailing list