def transform_visitor(transform_generator, callback)
callback is def callback(*, node: Optional[Node] = None, edge: Optional[Edge] = None, **kwds)
Then this wrapper does the isinstance checks and makes the right call.
Use a function and not an object visitor so it can do closures.
def transform_visitor(transform_generator, callback) callback is def callback(*, node: Optional[Node] = None, edge: Optional[Edge] = None, **kwds) Then this wrapper does the isinstance checks and makes the right call. Use a function and not an object visitor so it can do closures.