def test_iter(self): ast = AST() ast['name'] = 'hello' ast['name'] = 'world' ast['value'] = 1 self.assertEqual(['name', 'value'], list(ast)) self.assertEqual([['hello', 'world'], 1], list(ast.values()))
def from_ast(x: AST) -> str: return list(x.values())[0][1:-1]