Simon Willison’s Weblog

6 items tagged “monkeypatching”

What’s wrong with extending the DOM. Detailed explanation of the problems that crop up from extending built-in DOM objects using JavaScript, from Prototype developer kangax. Prototype 2.0 will be dropping this technique entirely—will MooTools follow suit? # 11th April 2010, 10:03 pm

The Perl community has a long-standing love/hate-affair with making changes that impose “spooky action at a distance”. They call it “black magic” and it is generally considered it a last resort. Black Magic that makes GLOBAL changes to things like inheritance is often characterised as being “Octarine” (see disk world novels), because it tends to work ok when there’s only one person doing it, but start to mix a few together and KABOOM!

Adam Kennedy # 22nd March 2008, 12:28 am

Monkeypatching is Destroying Ruby (via) Deliberately provocative title, but makes a well considered case for restrained use of monkey patching in Ruby. Cultural norms around monkey patching seem to me to be one of the core differences between the Ruby and Python communities. # 22nd March 2008, 12:27 am

Hacking Contributed Models. Neat Django trick using monkeypatching to make some minor tweaks to built-in contributed models such as auth or flatpages. # 11th March 2008, 5:51 am

Monkeypatching idioms—elegant or ugly? Guido offers a decorator and a metaclass as syntactic sugar for monkeypatching existing Python classes. # 30th January 2008, 12:39 am

Test stubbing httplib2. Nice demonstration of monkey-patching as part of unit testing in Python. # 10th May 2007, 11:24 pm