add tree walking to deal with __slots__