Intercepts¶
Release v0.3.0. (Installation)
Note
Intercepting builtin functions and methods is currently not working correctly and has been disabled. Unfortunately, this means that most of the examples shown in this documentation do not work. I am working on fixing these issues. – David
Intercepts allows you to intercept any function call in Python and handle it in any manner you choose.
>>> def print_handler(print_func, message):
... return print_func(''.join(reversed(message)))
>>> print("Hello world")
Hello world
>>> intercepts.register(print, print_handler)
>>> print("Hello world")
dlrow olleH