From 3f963008866e65e35027c4a60500676aaa352bb6 Mon Sep 17 00:00:00 2001 From: nathanielce24 Date: Sat, 10 Jan 2026 02:43:48 -0600 Subject: [PATCH] Change MusicBand class to StrEnum (issue #73) (#80) Changed to StrEnum, which avoids the need for multiple inheritance (str, Enum) and makes the intent clearer --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3ed478a..7011b9d 100644 --- a/README.md +++ b/README.md @@ -197,11 +197,11 @@ Pydantic has a rich set of features to validate and transform data. In addition to standard features like required and optional fields with default values, Pydantic has built-in data processing tools like regex validation, enums, string manipulation, email validation, and more. ```python -from enum import Enum +from enum import StrEnum from pydantic import AnyUrl, BaseModel, EmailStr, Field -class MusicBand(str, Enum): +class MusicBand(StrEnum): AEROSMITH = "AEROSMITH" QUEEN = "QUEEN" ACDC = "AC/DC"