Skip to content

Commit 62ac8e1

Browse files
kaushikskcodereverser
authored andcommitted
Make TransactionType a str enum instead of int
1 parent e2f14a0 commit 62ac8e1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

casparser/enums.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@ class CASFileType(IntEnum):
1717
DETAILED = 2
1818

1919

20-
class TransactionType(Enum):
20+
class TransactionType(str, Enum):
21+
# noinspection PyMethodParameters
22+
def _generate_next_value_(name, start, count, last_values) -> str: # type: ignore
23+
"""
24+
Uses the name as the automatic value, rather than an integer
25+
See https://docs.python.org/3/library/enum.html#using-automatic-values for reference
26+
"""
27+
return name
28+
2129
PURCHASE = auto()
2230
PURCHASE_SIP = auto()
2331
REDEMPTION = auto()

0 commit comments

Comments
 (0)