i think this should be a class property  eg class basehostmanager host manager hostmanager  property def host state cls self  host  node kwargs factory function property to create a new hoststate  may be overridden in subclasses to extend functionality  return nodestate host  node kwargs 