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
_______________________________________________
code-quality mailing list -- code-quality@python.org
To unsubscribe send an email to code-quality-le...@python.org
https://mail.python.org/mailman3/lists/code-quality.python.org/

Reply via email to