From a1d4d07f2ca6beb01a8db1b72f66120fc6ba33cb Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Tue, 29 Oct 2024 17:20:15 -0700 Subject: [PATCH] Mention use of cast in enum type stub example (#1877) --- docs/spec/enums.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/spec/enums.rst b/docs/spec/enums.rst index a3fa1ccd..fe38a358 100644 --- a/docs/spec/enums.rst +++ b/docs/spec/enums.rst @@ -123,8 +123,9 @@ statically in cases where dynamic values are used. genus: str # Non-member attribute species: str # Non-member attribute - CAT = ... # Member attribute - DOG = ... # Member attribute + CAT = 1 # Member attribute with known value and type + DOG = cast(int, ...) # Member attribute with unknown value and known type + BIRD = ... # Member attribute with unknown value and type * Members defined within an enum class should not include explicit type annotations. Type checkers should infer a literal type for all members.