Skip to content

Methodize try

Bert Palm requested to merge methotizeTry into develop

minimal example how we could make methods from our functions without changing much code.

idea:

  • wrap becomes a real decorator
  • preCall and postCall from register are called directly in SaQC._callFunction
  • data and flags are passed via self._prepared to the method body and returned via self._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

Merge request reports

Loading