def __init__(self, msg, kargs): # pylint: disable-msg=W0142 Node.__init__(self, msg, kargs) if 'in_all' in kargs: SyntaxError.__init__( self, msg, (kargs.get('in_filename', ''), int(kargs.get('in_lineno', 0)), int(kargs.get('in_char', 0)), kargs.get('in_all'))) else: SyntaxError.__init__( self, msg, (kargs.get('in_filename', ''), int(kargs.get('in_lineno', -1)), int(kargs.get('in_offset', 1)), kargs.get('in_rest', '')))
def __init__(self, msg, kargs): # pylint: disable-msg=W0142 Node.__init__(self, msg, kargs) if 'in_all' in kargs: SyntaxError.__init__(self, msg, (kargs.get('in_filename', ''), int(kargs.get('in_lineno', 0)), int(kargs.get('in_char', 0)), kargs.get('in_all'))) else: SyntaxError.__init__(self, msg, (kargs.get('in_filename', ''), int(kargs.get('in_lineno', -1)), int(kargs.get('in_offset', 1)), kargs.get('in_rest', '')))
def __init__(self, msg, location): # pylint: disable-msg=W0142 Node.__init__(self, msg, location) SyntaxError.__init__(self, msg, location)
def test_order(self): tree = Node(1, 2, Node(3, Node(4), Node(), 5)) result = list(leaves(tree, Node)) assert result == [1, 2, 3, 4, 5], result