for c in cls.mro():
if hasattr(c, "_rfm_pipeline_hooks"):
for kind, hook in c._rfm_pipeline_hooks.items():
ret.setdefault(kind, [])
ret[kind] += hook
return ret
After Change
def pipeline_hooks(cls):
ret = {}
for phase, hooks in cls._rfm_pipeline_hooks.items():
ret[phase] = []
for h in hooks:
ret[phase].append(h.fn)
return ret