I am looking for a way to recreate / reinstantiate an object in python, because I want the object to have a default attribute in each loop.
for case in all_case:
# i want in each loop it's create a new object / reinstantiate it
pda = PushDownAutomata()
print pda.evaluate(case, debug=False)
# already add "del pda" but it's not working
Note that class attributes are not the same as instance attributes. for example:
class A(object): a = None # this is a class attribute def __init__(self, b): self.b = b # b is an instance attribute