Modify a Function During Run-time
Have you ever been in a situation where you wished to add more details to an already running code?
This is typically observed in ML where one often forgets to print all the essential training details/metrics. Executing the entire code again, especially when it has been up for some time is not an ideal approach here.
If you want to modify a function during execution, decorate it with the reloading decorator (@𝐫𝐞𝐥𝐨𝐚𝐝𝐢𝐧𝐠). As a result, Python will reload the function from the source before each execution.
Link to reloading: GitHub.
Read this post on LinkedIn here: Link.