Skip to content

Commit fe186bf

Browse files
committed
Python: Add test
1 parent 64b9e91 commit fe186bf

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
def test_conditoinal_function(cond):
2+
def foo():
3+
return "foo"
4+
5+
def bar():
6+
return "bar"
7+
8+
if cond:
9+
f = foo
10+
else:
11+
f = bar
12+
13+
sink = f()
14+
return sink
15+
16+
17+
f_false = test_conditoinal_function(False)
18+
f_true = test_conditoinal_function(True)
19+
20+
21+
def foo():
22+
return "foo"
23+
24+
25+
def test_redefinition():
26+
f = foo
27+
28+
def foo():
29+
return "refined"
30+
31+
sink = f()
32+
return sink

0 commit comments

Comments
 (0)