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


Groups > comp.lang.python > #105217

Re: monkey patching __code__

From Ian Kelly <ian.g.kelly@gmail.com>
Newsgroups comp.lang.python
Subject Re: monkey patching __code__
Date 2016-03-18 08:23 -0600
Message-ID <mailman.321.1458311029.12893.python-list@python.org> (permalink)
References <56EBEB5A.7050207@mail.de> <CALwzid=XVSnSEt14Oer-2dO-0kT+fLi1EP4mNehXc0+zDqTX=g@mail.gmail.com>

Show all headers | View raw


On Fri, Mar 18, 2016 at 7:47 AM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
> Your patched version takes two extra arguments. Did you add the
> defaults for those to the function's __defaults__ attribute?

And as an afterthought, you'll likely need to replace the function's
__globals__ with your own as well.

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


Thread

Re: monkey patching __code__ Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-18 08:23 -0600

csiph-web