-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.py
54 lines (39 loc) · 904 Bytes
/
example.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
import sys
class Useless:
def __del__(self):
print('destroyed!', self)
class A(object):
def __init__(self, name, x):
self.name = name
self.x = x
def compute(self, other):
c = other.x + self.x
return c
def foo(self):
u = Useless()
self.x = 55
self.name = 44
print(self.name)
return 55
def example(ainst):
def inner():
print("rffff")
b = ainst.x + 6
c = 4 + b + ainst.x
print("Val", ainst.name)
x = [z + ainst.x for z in range(5)]
inner()
return x[0]
# if c - 120 == 0:
# c = c + 6
# return c
# c = c > 0 or c != 0
# return c
a1 = A("a1", 55)
a2 = A("a2", 100)
import dbge; dbge.set_trace()
# import ipdb; ipdb.set_trace()
a1.foo()
print("Result 1", a1.compute(a2))
print("Result 2", a2.compute(a2))
print("Result 3", example(a1) + 4)