From 577de6c5995360dcb4a9fb2dc8ff820de9d788c2 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 14 Nov 2024 17:22:43 +0000 Subject: [PATCH] [red-knot] Clarify a TODO comment in a `sys.version_info` test (#14340) --- .../resources/mdtest/sys_version_info.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/red_knot_python_semantic/resources/mdtest/sys_version_info.md b/crates/red_knot_python_semantic/resources/mdtest/sys_version_info.md index 08282e677f..a47643a002 100644 --- a/crates/red_knot_python_semantic/resources/mdtest/sys_version_info.md +++ b/crates/red_knot_python_semantic/resources/mdtest/sys_version_info.md @@ -52,8 +52,10 @@ import sys reveal_type(sys.version_info >= (3, 8, 1)) # revealed: bool reveal_type(sys.version_info >= (3, 8, 1, "final", 0)) # revealed: bool -# TODO: this is an invalid comparison (`sys.version_info` is a tuple of length 5) -# Should we issue a diagnostic here? +# TODO: While this won't fail at runtime, the user has probably made a mistake +# if they're comparing a tuple of length >5 with `sys.version_info` +# (`sys.version_info` is a tuple of length 5). It might be worth +# emitting a lint diagnostic of some kind warning them about the probable error? reveal_type(sys.version_info >= (3, 8, 1, "final", 0, 5)) # revealed: bool # TODO: this should be `Literal[False]`; see #14279