Python: NoneType errors.Do they look familiar
<p>I've been looking for the NoneType for half a day. I've put 'print' and dir() all through the generation of the Object represented by t2. I've looked at the data structure after the crash using 'post mortem' and nowhere can I find a NoneType.
I was wondering if perhaps it's one of those errors that are initiated by some other part of the code (wishful thinking) and I was wondering if anybody recognizes this?
( k2 is an 'int' )</p>

<pre><code> File "C:\Python26\Code\OO.py", line 48, in removeSubtreeFromTree
    assert getattr(parent, branch) is subtreenode
TypeError: getattr(): attribute name must be string, not 'NoneType

 File "C:\Python26\Code\OO.py", line 94, in theSwapper
    st2, p2, b2 = self.removeSubtreeFromTree(t2, k2)
TypeError: 'NoneType' object is not iterable
</code></pre>
