Wrap and intercept function calls

alex23 wuwei23 at gmail.com
Thu Feb 18 03:42:44 CET 2010

Terry Reedy <tjre... at udel.edu> wrote:
> Now wrap *every* function you are interested in. Builtin functions are
> no problem; methods of builtin classes cannont be wrapped without
> subclassing.

It's a shame it's not possible to do:

    type.__call__ = func_wrap(type.__call__)

Or even:

    type.__class__ = NewType

More information about the Python-list mailing list