summaryrefslogtreecommitdiffstats
path: root/yql/essentials/udfs/common/python/python3_small/test/cases/LinearDynamicFail3.sql
blob: 8ba3db4fe0b04422d2397bd5388837783e214e3b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
$s = @@
def f(x):
    class Once:
        def __init__(self, v):
            self.v = v
            self.extracted = False

        def extract(self):
            assert not self.extracted
            self.extracted = True
            ret = self.v
            self.v = None
            return ret

    return Once(x + 1)

def g(x):
    return 1
@@;

$p = Python::f(Callable<(Int32)->DynamicLinear<Int32>>, $s);
$c = Python::g(Callable<(DynamicLinear<Int32>)->Int32>, $s);

select $c($p(1));