Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
Use a stack of names. Every time when you enter a class and function nodes, push the current name on the stack, and pop it out after handling child nodes. Compare the qualified name with '.'.join(self.stack). Don't use the recursive decorator, it is not suitable for this, because you need to execute some code before and after handling child nodes. Just add a loop for child nodes in your handler. Yet one thing that you should take to account: decorators. In you should return the line number of the first decorator if they are used. This is easy. This is an interesting issue. I would take it if you do not already working on it. But I think it should be interesting and useful to you. Good practice. Once you get some working code, create a PR. I will suggest next steps. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35113> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com