class Player:
# __slots__ = ['name','age','gsnum']
def __init__(self,name,age,gsnum):
self.name = name
self.age = age
self.gsnum = gsnum
I defined this class, with three attributes
when using __slots__
to save memory:
I get 36 for one instance (sys.getsizeof()
)
if not using the __slots__
,
I still get 36 as the memory size,
What's the problem here? 32bit Python 2.7