is this the right way to do subclasses?
John Salerno
johnjsal at NOSPAMgmail.com
Thu Nov 9 10:32:57 EST 2006
Steve Holden wrote:
>> Wait, I just might be an idiot. Is it not even necessary for me to
>> call Character's __init__ method? Fighter will inherit it
>> automatically and call it when a Fighter object is created, right?
>>
> By Jove, he's got it!
But I was thinking...even though there are better ways to do it than
what I did, I wasn't too far off the mark since I really *was*
overriding the __init__ and doing some extra initializing of my own in
each subclass. It was just a terribly ugly way to do it. :)
More information about the Python-list
mailing list