Skip to content

Commit b085cf5

Browse files
authored
Final QA updates (#309)
1 parent ae616d6 commit b085cf5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: python-enum/inheritance.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
class BaseTextEnum(Enum):
66
def as_list(self):
7-
if not len(self.value):
8-
raise NotImplementedError("empty enum member")
9-
return [item for item in self.value]
7+
try:
8+
return list(self.value)
9+
except TypeError:
10+
return [str(self.value)]
1011

1112

1213
class Alphabet(BaseTextEnum):

0 commit comments

Comments
 (0)