Skip to content

Commit 0ce5d2e

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

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

statelint/fields/common.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import json
2-
from enum import Enum
2+
from enum import StrEnum
33
from typing import Any
44

55

6-
class Comparison(str, Enum):
6+
class Comparison(StrEnum):
77
STRING_EQUALS = "StringEquals"
88
STRING_LESS_THAN = "StringLessThan"
99
STRING_GREATER_THAN = "StringGreaterThan"
@@ -45,7 +45,7 @@ class Comparison(str, Enum):
4545
STRING_MATCHES = "StringMatches"
4646

4747

48-
class StateType(str, Enum):
48+
class StateType(StrEnum):
4949
PASS = "Pass"
5050
SUCCEED = "Succeed"
5151
FAIL = "Fail"

statelint/problem/problem_type.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from enum import Enum
1+
from enum import StrEnum
22

33

4-
class ProblemType(str, Enum):
4+
class ProblemType(StrEnum):
55
# type check
66
FLOAT = "a Float"
77
STRING = "a String"

0 commit comments

Comments
 (0)