def visit(self, node, *args, **kwargs):
        """
        Visit the visitor with some object.

        @param node: An object to call a visitor method with.
        @param args: Arguments to go with the visitor method call.
        @param kwargs: Keyword arguments to go with the visitor method call.
        @return: The return value of the method that was called for visiting object.
        """
        method = None
        for cls in node.__class__.__mro__:
            method_name = 'visit_' + cls.__name__.lower()
            method = getattr(self, method_name, None)
            if method:
                break

        if not method:
            method = self.generic_visit
        return method(node, *args, **kwargs)

        Visit the visitor with some object.

        @param node: An object to call a visitor method with.
        @param args: Arguments to go with the visitor method call.
        @param kwargs: Keyword arguments to go with the visitor method call.
        @return: The return value of the method that was called for visiting object.
        
pypattyrn/behavioral/visitor.py