Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #35063

Re: Is it possible monkey patch like this?

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Is it possible monkey patch like this?
Date 2012-12-18 11:49 -0500
References <bbfb8154-e283-4961-9680-9d819bf00d01@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.1023.1355849362.29569.python-list@python.org> (permalink)

Show all headers | View raw


On 12/18/2012 5:26 AM, Marc Aymerich wrote:

> I want to monkey patch a method that has lots of code so I want to
> avoid copying all the original method for changing just two lines.

You omitted the most important piece of information. Can you modify the 
original code (or get someone else to do so) or must you leave it as is? 
Chris and Peter gave you answers for the former case. If the latter, you 
must copy and modify for the change you specified.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Is it possible monkey patch like this? Marc Aymerich <glicerinu@gmail.com> - 2012-12-18 02:26 -0800
  Re: Is it possible monkey patch like this? Chris Angelico <rosuav@gmail.com> - 2012-12-18 21:34 +1100
  Re: Is it possible monkey patch like this? Peter Otten <__peter__@web.de> - 2012-12-18 13:35 +0100
  Re: Is it possible monkey patch like this? Terry Reedy <tjreedy@udel.edu> - 2012-12-18 11:49 -0500
  Re: Is it possible monkey patch like this? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-19 00:54 +0000

csiph-web