So, I have looked into this question and haven't gotten what I see to be a solid answer, or maybe I just am lacking an understanding of this. Essentially I want to know:
A. Is it bad practice to have many instances of the same class?
B. What is a way to get rid of an overwhelming amount of instances without the program exiting?
Let me explain. Say I want to write a Zero Person RPG that is running in the background consistently. So I create an Enemy class for the Hero to slay.
class Enemy:
# Attr = Stats held in a dict
def __init__(self, attr={}):
self.attr = attr
A simple example. Is there an alternative to having to do the following hundreds of times?
giant = Enemy({'atk': 10, 'def': 5})
poltergeist = Enemy({'atk': 7, 'def' 8})
...
Or is this seen as the pythonic way?