質問編集履歴

2

修正

2021/03/10 14:27

投稿

person
person

スコア224

test CHANGED
File without changes
test CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- ```Python:
9
+ ```Python
10
10
 
11
11
  def callback(func):
12
12
 
@@ -22,7 +22,7 @@
22
22
 
23
23
 
24
24
 
25
- # TypeError: 'NoneType' object is not callable
25
+ #TypeError: 'NoneType' object is not callable
26
26
 
27
27
 
28
28
 
@@ -32,8 +32,8 @@
32
32
 
33
33
 
34
34
 
35
- # callback1
35
+ #callback1
36
36
 
37
- # callback2
37
+ #callback2
38
38
 
39
39
  ```

1

実行結果の追加

2021/03/10 14:27

投稿

person
person

スコア224

test CHANGED
File without changes
test CHANGED
@@ -10,14 +10,30 @@
10
10
 
11
11
  def callback(func):
12
12
 
13
- print("callback")
13
+ print("callback1")
14
14
 
15
15
  func()
16
+
17
+ print("callback2")
16
18
 
17
19
 
18
20
 
19
21
  #func(None)
20
22
 
23
+
24
+
25
+ # TypeError: 'NoneType' object is not callable
26
+
27
+
28
+
29
+
30
+
21
31
  func(lambda:None)
22
32
 
33
+
34
+
35
+ # callback1
36
+
37
+ # callback2
38
+
23
39
  ```