![](https://secure.gravatar.com/avatar/f0b3e608e73a513b3d29628b6ba2f158.jpg?s=120&d=mm&r=g)
Thank you very much for your answer. I figureed my self how to do it. 1) get the entry from the locals dictionary of the module defining the class 2) check if the list representing the class contains more than one ClassDef astroid node. 3) In my case the parent node of the ClassDef node is an If astroid node which separates between python3 and python2 4) pop either version from the locals entry of module dependent whether checking for python3 or python2 5) remove the ClassDef node from the body or orelse structure of parent node beeing and If node 6) check if next entry on bases structure of node has a lookup method 7) if has lookup method than call clear_cache method on lookup method object to clear functools.cache 8) repeat 6 and 7 with all remaining entries bases structure of node 9) return node With the above i managed to at least handle it properly for Python3 and Pylint 3 not tested yet on python2 and pylint2