I am aware of this; but with too much Java still running through my
brain I've never bothered with the idea yet because that's simply not
the way I learned and I've never had a chance to need new attributes
for singular instances.
"__slots__ is not a method, so it falls outside that purpose as sta
Well, my computer tends to run at about 497 to 501 out of 504 MB of RAM
used once I start up Gnome, XMMS, and a few Firefox tabs, and I'd
prefer not to see things slipping into Swap space if I can avoid it,
and the fighter data would be only part of a larger program.
And as I said, learning how to
>>> class Fighter(object):
... '''Small one man craft that can only harm other fighters on
their own.'''
... __slots__ = ["fuel","life","armor","weapon","bulk"]
... def __init__(self,statsTuple=(50,5,0,(2,4),1)):
... self.fuel = statsTuple[0]
... self.life = stat
>>> class Fighter:
... '''Small one man craft that can only harm other fighters on
their own.'''
... def __init__(self,statsTuple=(50,5,0,(2,4),1)):
... self.fuel = statsTuple[0]
... self.life = statsTuple[1]
... self.armor = statsTuple[2]
...