From d7af42766f1a3540bf6c4eba4cbffd743dd1bc7c Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 6 Jul 2026 16:44:36 +0500 Subject: [PATCH] Clarify Python 3.10+ version check Added a comment clarifying why this check is needed. Used `>=` instead of `>`, though `(3,10,0) > (3,10)` also evaluates to `True`, just to make it more explicit. --- trinary.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/trinary.py b/trinary.py index 31c7abe..4b09fa8 100644 --- a/trinary.py +++ b/trinary.py @@ -129,7 +129,9 @@ def __bool__(self): Unknown: Final[UnknownClass] = UnknownClass() -if sys.version_info > (3, 10): +# `isinstance(x, Union)` only supported in 3.10+. +# In previous versions we rely on `isinstance(x, ABC)`. +if sys.version_info >= (3, 10): Trinary = Union[bool, UnknownClass]