Well,
I think I found the perfect solution to me (Didn't know this use). Just define them as class variables and classmethods decorator and the variables have the same value across all the instances:
I think I found the perfect solution to me (Didn't know this use). Just define them as class variables and classmethods decorator and the variables have the same value across all the instances:
class AlertsHandler: """ Defines all the operations that are required to process all the NIMFty alerts. This handler uses class variables that have the same value across all class instances """ alert_1 = [] alert_2 = [] alert_3 = [] ... @classmethod def send_alerts(cls): """ Sends alerts (emails) about the process execution :return: None """ ...And in my code I just:
AlertsHandler.alert_1.append(x)
AlertsHandler.send_alerts()when I need :)