From 48bd065b14c5b61cc94227ed5532a97db8ac5a45 Mon Sep 17 00:00:00 2001 From: Niklas Fiekas Date: Wed, 2 Aug 2023 21:25:18 +0200 Subject: [PATCH] Add ColorName literal type --- chess/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chess/__init__.py b/chess/__init__.py index 0604cec54..65719fd5c 100644 --- a/chess/__init__.py +++ b/chess/__init__.py @@ -29,7 +29,8 @@ Color = bool COLORS = [WHITE, BLACK] = [True, False] -COLOR_NAMES = ["black", "white"] +ColorName = Literal["white", "black"] +COLOR_NAMES: List[ColorName] = ["black", "white"] PieceType = int PIECE_TYPES = [PAWN, KNIGHT, BISHOP, ROOK, QUEEN, KING] = range(1, 7)