Applying decorators to built in Python functions?
Is it possible to do this? We have huge codebase making use of some of standard python modules and we see that in our environment some of the python standards functions needs us to do some additional retries or changes in their call flow, currently we are wrapping those standards functions inside our own functions and making use of it, but was wondering if we can write a decorators which can be applied to standards functions in python, so that if someone uses standard functions in code base our modified routine should also be invoked.
Any suggestions comments are welcome
Posted Jun 2, 2022, 8:40 AM UTC
Yes
But don't. You will regret it.