def __call__(self, arg_type):
<EOL>def _visitor_impl(new_self, arg, *args, **kwargs):<EOL><INDENT>"""<STR_LIT>"""<EOL>method = self[type(arg)]<EOL>return method(new_self, arg, *args, **kwargs)<EOL><DEDENT>def decorator(fn):<EOL><INDENT>self[arg_type] = fn<EOL>return _visitor_impl<EOL><DEDENT>return decorator<EOL>
Decorator that creates a visitor method.