pylint-bot / astroid-unofficial

UNOFFICIAL playground for astroid github migration
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Eliminate pattern duplication among visitors and visitor-like methods, add a visitor API #196

Open pylint-bot opened 9 years ago

pylint-bot commented 9 years ago

Originally reported by: BitBucket: ceridwenv, GitHub: ceridwenv


There are two different visitor implementations in astroid, one in as_string.py and the other in transforms.py, one using the accept method on nodes and the other dispatching on node type. There are also some functions and methods with visitor-like behavior. I think it would be better to have one single visitor that astroid uses internally and since the standard lib ast module has two visitors, ast.NodeVisitor and ast.NodeTransformer, we should have a similar external visitor API.