Skip to content

Commit 8183604

Browse files
committed
fix: Enum with str or int Mixin Breaking Change in Python 3.11
python/cpython#100458
1 parent 2010ba0 commit 8183604

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

statelint/fields/common.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55

66
class Comparison(str, Enum):
7+
def __str__(self) -> str:
8+
return self.value
9+
710
STRING_EQUALS = "StringEquals"
811
STRING_LESS_THAN = "StringLessThan"
912
STRING_GREATER_THAN = "StringGreaterThan"
@@ -46,6 +49,9 @@ class Comparison(str, Enum):
4649

4750

4851
class StateType(str, Enum):
52+
def __str__(self) -> str:
53+
return self.value
54+
4955
PASS = "Pass"
5056
SUCCEED = "Succeed"
5157
FAIL = "Fail"

statelint/problem/problem_type.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33

44
class ProblemType(str, Enum):
5+
def __str__(self) -> str:
6+
return self.value
7+
58
# type check
69
FLOAT = "a Float"
710
STRING = "a String"

0 commit comments

Comments
 (0)