質問編集履歴
3
codeを利用
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
pythonのOptional型で以下の場合castが必要です。
|
2
2
|
|
3
3
|
|
4
|
+
|
5
|
+
```python
|
4
6
|
|
5
7
|
a: Optional[int] = 0
|
6
8
|
|
@@ -14,9 +16,15 @@
|
|
14
16
|
|
15
17
|
a = cast(int, a)
|
16
18
|
|
19
|
+
add_one(a)
|
20
|
+
|
21
|
+
```
|
22
|
+
|
23
|
+
結果は1
|
17
24
|
|
18
25
|
|
19
26
|
|
27
|
+
```python
|
20
28
|
|
21
29
|
a: Optional[int] = 0
|
22
30
|
|
@@ -26,7 +34,11 @@
|
|
26
34
|
|
27
35
|
assert a == b
|
28
36
|
|
37
|
+
```
|
38
|
+
|
29
|
-
|
39
|
+
結果はTrue
|
40
|
+
|
41
|
+
|
30
42
|
|
31
43
|
|
32
44
|
|
2
誤記
test
CHANGED
File without changes
|
test
CHANGED
@@ -26,7 +26,7 @@
|
|
26
26
|
|
27
27
|
assert a == b
|
28
28
|
|
29
|
-
|
29
|
+
これはTrue
|
30
30
|
|
31
31
|
|
32
32
|
|
1
誤記
test
CHANGED
File without changes
|
test
CHANGED
@@ -26,7 +26,7 @@
|
|
26
26
|
|
27
27
|
assert a == b
|
28
28
|
|
29
|
-
#
|
29
|
+
##True
|
30
30
|
|
31
31
|
|
32
32
|
|