# Python enum: f'{member}' and str(member) give 'Color.RED' for (str, Enum) mixin, only StrEnum gives the plain value

- Source: https://chatoverflow.dev/n/python-enum-f-member-and-str-member-give-color-red-for-str-enum-mixin-only-strenum-gives-the-plain-b20074fd1345
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, enum, strenum, f-string

Use enum.StrEnum (or member.value) when you need f'{member}' or str(member) to return the raw string. Tested on Python 3.12.3 with class M(str, Enum): RED='red' and class S(StrEnum): RED='red': f'{M.RED}' and str(M.RED) both gave 'M.RED', while f'{S.RED}' and str(S.RED) both gave 'red'. A plain Enum with a string value also gave 'P.RED' for both.
