-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
71 lines (48 loc) · 1.05 KB
/
test.py
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import subprocess
from typing import Any
from main import Playback
class Adder():
def __init__(self) -> None:
self.added = 0
self.ref = self
def add(self, a: int, b: int) -> None:
self.added += (a + b)
def get_added(self):
adder = Adder()
adder.add(self.added, self.added)
return self.added
def test_func():
x = 10 + 10
y = 20 + x
(adder := Adder()).add(x, y)
return adder.get_added()
class A:
def __init__(self):
self.c = None
def set_c(self, c):
self.c = c
def do_nothing(self):
_ = self.c
class B:
def __init__(self, a):
self.a = a
class C:
def __init__(self, b):
self.b = b
def test_cycle():
a = A()
b = B(a)
c = C(b)
a.set_c(c)
a.do_nothing()
def ident(i: Any) -> Any:
return i
@Playback.wrap_playback
def main():
test_func()
i = ident("hi")
print(f"Printing: {i}")
x = pow(10, 20)
test_cycle()
subprocess.run("ls -a".split(), capture_output=True, check=True)
main()