Skip to content

Commit f17fe44

Browse files
committed
Python: Expand test of py/use-of-input
1 parent 0292ca6 commit f17fe44

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
| UseofApply.py:19:3:19:17 | ControlFlowNode for apply() | Call to the obsolete builtin function 'apply'. |
2-
| expressions_test.py:3:5:3:21 | ControlFlowNode for apply() | Call to the obsolete builtin function 'apply'. |
2+
| expressions_test.py:2:5:2:21 | ControlFlowNode for apply() | Call to the obsolete builtin function 'apply'. |
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1-
21
def use_of_apply(func, args):
32
apply(func, args)
43

4+
55
def use_of_input():
6-
return input()
6+
return input() # NOT OK
7+
8+
9+
def not_use_of_input():
10+
input = raw_input
11+
return input() # OK
12+
713

14+
if __name__ == "__main__":
15+
# if you enter 4+4 each time, you'll see that results are: 8, '4+4', 8
16+
print("result:", use_of_input())
17+
print("result:", not_use_of_input())
18+
print("result:", use_of_input())

0 commit comments

Comments
 (0)