What about a decorator that patches the bytecode of the supplied function? That would not technically replace it, but would change its behaviour.
What about a decorator that patches the bytecode of the supplied function? That would not technically replace it, but would change its behaviour.