Skip to content

Commit

Permalink
fix: Enum with str or int Mixin Breaking Change in Python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
taro-kayo committed May 27, 2023
1 parent 2010ba0 commit 8183604
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions statelint/fields/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@


class Comparison(str, Enum):
def __str__(self) -> str:
return self.value

STRING_EQUALS = "StringEquals"
STRING_LESS_THAN = "StringLessThan"
STRING_GREATER_THAN = "StringGreaterThan"
Expand Down Expand Up @@ -46,6 +49,9 @@ class Comparison(str, Enum):


class StateType(str, Enum):
def __str__(self) -> str:
return self.value

PASS = "Pass"
SUCCEED = "Succeed"
FAIL = "Fail"
Expand Down
3 changes: 3 additions & 0 deletions statelint/problem/problem_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@


class ProblemType(str, Enum):
def __str__(self) -> str:
return self.value

# type check
FLOAT = "a Float"
STRING = "a String"
Expand Down

0 comments on commit 8183604

Please sign in to comment.