Is it possible to make a class call del()
for some instances under some condition? Or turn self into None?
class T:
def __init__(self, arg1, arg2):
condition=check_condition(arg1,arg2)
if not condition:
do_something(arg1)
else:
del(self) #or self=None or return None
I need to do something like this to be sure that will never exist a kind of instance.