Background
I have a task executioner framework that allows people to write code like this.
class HandleJob(Job):
@Step()
def do_work(self, work_order):
pass
@Step()
def continue_with_doing_work(self, work_order):
pass
The framework calls the steps in a defined order and pass along the work order. The important thing to know though is that the different Steps can be called by different instances of HandleJob, or rather during different executions of the script. This means that a developer CANNOT write stuff to self in one Step and expect it to be available in another Step.
There is a dedicated place to store data needed later and documentation is clear about this. However, I still want to be able to enforce 'fail early'.
Question (TLDR)
Is there some way I can lock down the scope preventing developers from writing variables to self during runtime.
To complicate things further. They should be able to write to self in the constructor.