What's the best way to write this base class?
John Salerno
johnjsal at gmail.com
Sat Jun 18 12:26:39 EDT 2011
Whew, thanks for all the responses! I will think about it carefully
and decide on a way. I was leaning toward simply assigning the health,
resource, etc. variables in the __init__ method, like this:
def __init__(self, name):
self.name = name
self.health = 50
self.resource = 10
I never did like the idea of using the parameters if I never intended
to pass them in...just seems wrong. :)
The idea of not using a base Character class at all threw me for a
loop though, so I need to think about that too!
More information about the Python-list
mailing list