From d11c6b1426486601f482ee1dad927d15c494d44b Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Mon, 10 Aug 2026 15:44:12 -0700 Subject: [PATCH] [ty] fix mdtest prose about string literal identity checks --- .../resources/mdtest/narrow/conditionals/is.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ty_python_semantic/resources/mdtest/narrow/conditionals/is.md b/crates/ty_python_semantic/resources/mdtest/narrow/conditionals/is.md index 3e69400f8e2a94..18c8a2d43784c8 100644 --- a/crates/ty_python_semantic/resources/mdtest/narrow/conditionals/is.md +++ b/crates/ty_python_semantic/resources/mdtest/narrow/conditionals/is.md @@ -538,9 +538,9 @@ def literal_string(value: object, text: LiteralString) -> None: reveal_type(value) # revealed: LiteralString ``` -A string without known literal origin can have the same runtime value as an excluded string literal. -Identity preserves the existing origin exclusion instead of making the successful branch -unreachable. +The same string object (same memory address) can be referenced by multiple different expressions +(due to aliasing or interning). Some of those expressions may be validly typed as having literal +origin and others may not. Checking string identity does not assume this is impossible: ```py def negated_string_literal(value: Not[Literal["hello"]]) -> None: