If it is so, please do not hesitate to close question as duplicate. :)
In my code, I have a lot of blocks that look like
try:
load_from_disk(pathtofile)
except IOError:
datapiece = comp_this_data( **dictofargs )
save_to_disk(pathtofile, datapiece)
Question: How to define a routine that takes care of possible precomputed data for different comp_this_data
?
Maybe, this is an easy case for python decorators. However, as I understood, the decorator is part of the function definition, which I don't want to change.
Any ideas?