Methodize try
minimal example how we could make methods from our functions without changing much code.
idea:
-
wrap
becomes a real decorator -
preCall
andpostCall
from register are called directly inSaQC._callFunction
- data and flags are passed via
self._prepared
to the method body and returned viaself._result
what we would need to do:
old
flagSome(data, field, flags, arg, ... , kw=None, **kwargs):
... # code
return data, flags
new
flagSome(self, field, arg, ... , kw=None, **kwargs):
data, flags = self._prepared
... # code
self._result = data, flags
return self
Edited by Bert Palm