Clear all class variables between instances
- by ensnare
This is probably a stupid question, but what's the best way to clear class variables between instances?
I know I could reset each variable individually in the constructor; but is there a way to do this in bulk?
Or am I doing something totally wrong that requires a different approach? Thanks for helping ...
class User():
def __init__(self):
#RESET ALL CLASS VARIABLES
def commit(self):
#Commit variables to database
>>u = User()
>>u.name = 'Jason'
>>u.email = '[email protected]'
>>u.commit()
So that each time User is called the variables are fresh.
Thanks.