Python, override__getstate__() __setstate__()
<p>I have this classes:</p>

<pre><code>class Family(object):
    __slot__ = ['father', 'var1']
    def __init__(self, father, var1 = 1):
        self.father, self.var1 = father var1

class Father(object):
    __slots__ = ['var2']
    def __init__(self, var2 = ''):
        self.var2 = var2

father = Father()
family = Family(father = father)
</code></pre>

<p>And i want to picke "family" object. so i need to override <code>__getstate__</code> and <code>__setstate__</code>
"Family" and "Father" classes.</p>

<p>Can you show me an efficient way of doing this.
(the reason why i use <code>__slots__</code> because  i have lot of objects and i am trying to save memory)</p>
