The problem is that the code in OP - besides everything - is used to both to store list of stores (pun unintended) and actual stores. Class attributes mask the design flaw, creating an illusion of a working code.
In a properly designed implementation,
In a properly designed implementation,
Store
class must contain a record of an individual store; container for stores may be another class, a dictionary or a list - but not the same class that contains the individual store record.
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.