I'm having a bit of a problem in python. It's not with the syntax or anything like that but, I am making a text rpg. I have a save/load feature within the game using pickle. It works just fine. But the problem is when I load the game, the inventory variable is set back to what I defined it as in the init of the main class. its like this:
class Main():
def __init__(self):
self.inventory = []
and the load command is in the main class as well. But for some reason when I load the variables with pickle, it resets the inventory to whatever it is set as in the main class. How can I stop this?