回答編集履歴
1
修正
answer
CHANGED
@@ -10,10 +10,11 @@
|
|
10
10
|
if event:
|
11
11
|
image_mode = Mode.gray
|
12
12
|
|
13
|
-
if image_mode
|
13
|
+
if image_mode is Mode.gray:
|
14
14
|
print('hoge')
|
15
15
|
```
|
16
16
|
|
17
|
+
**修正:** 比較をisに変更。[列挙型メンバーは同一性を比較できます](https://docs.python.jp/3/library/enum.html#comparisons)
|
17
|
-
[Wandbox](https://wandbox.org/permlink/
|
18
|
+
[Wandbox](https://wandbox.org/permlink/LicW0bwAaDy3nmnH)
|
18
19
|
|
19
20
|
文字列よりは用途が明確でわかりやすいかと。
|