And for such a behavior they've termed "monkeying" Thus, the coinage "Monkeypatching" for what you want to do:
http://mail.python.org/pipermail/python-dev/2008-January/076194.html There are a group of people who think "monkeypatching is destroying ruby." You still probably should avoid it for production code. On Fri, Apr 4, 2008 at 11:25 AM, John Nagle <[EMAIL PROTECTED]> wrote: > Bruno Desthuilliers wrote: > > Paul Rubin a écrit : > >> Brian Vanderburg II <[EMAIL PROTECTED]> writes: > >>> I've checked out some ways to get this to work. I want to be able to > >>> add a new function to an instance of an object. > >> > >> Ugh. Avoid that if you can. > > > > Why so ? OO is about objects, not classes, and adding methods on a > > per-object basis is perfectly legitimate. > > It's what professional programmers call a "l33t feature", > one not suitable for production code. Typically such features > are used by programmers with about two years experience, > trying too hard to prove that they're cool. > > John Nagle > -- > http://mail.python.org/mailman/listinfo/python-list >
-- http://mail.python.org/mailman/listinfo/python-list