Пример #1
0
def test_transform():
    t = symbol('t', '5 * {x: int, y: int}')
    expr = transform(t, z=t.x + t.y)
    assert expr.fields == ['x', 'y', 'z']

    assert builtins.any(
        (t.x + t.y).isidentical(node) for node in expr._subterms())
Пример #2
0
def test_transform():
    t = symbol('t', '5 * {x: int, y: int}')
    expr = transform(t, z=t.x + t.y)
    assert expr.fields == ['x', 'y', 'z']

    assert builtins.any((t.x + t.y).isidentical(node)
                        for node in expr._subterms())