To access the list object of outer class in the inner class in python -
class policy(object): def __init__(self,name): global policies_list self.policy_1_list=[] self.id=name policies_list.append(self) class policy_1: def __init__(self): policy_1_list.append(self)
how use policy_1_list list object of outer class policy in constructor of inner class policy_1? how refer outer class element?
Comments
Post a Comment