inheritance with new-style classes - help
Terry Reedy
tjreedy at udel.edu
Fri May 6 14:41:50 EDT 2005
"Greg Copeland" <gtcopeland2002 at yahoo.com> wrote in message
news:1115402296.414753.324000 at f14g2000cwb.googlegroups.com...
> Okay, I have:
[snip]
> self._childAttrib = "child"
...
> AttributeError: 'Child' object has no attribute '_childAttrib'
>>>> x.__dict__
> {'_attrib': 'base'}
>
> What??! Where the heck did self._childAttrib go? And why?
I don't immediately see the problem. Failing that, I would rerun with
print 'setting '_childAttrib' # and
print self._childAttrib
bracketing the line where it should be set, and go one from there.
Terry J. Reedy
More information about the Python-list
mailing list