

Discover more from Daily Dose of Data Science
High-quality insights on Data Science and Python, along with best practices — shared daily.
Get a free 550+ page data science PDF guide and 450+ practice questions notebook.
Over 50,000 subscribers
Continue reading
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.