From bd9aacaa0cb30091ba04ce168a4b30daa35bab5e Mon Sep 17 00:00:00 2001 From: Alon Ben-Arieh Date: Sun, 3 Aug 2025 19:34:52 +0300 Subject: [PATCH] check-python-version-instead-of-hasattr --- src/typing_extensions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/typing_extensions.py b/src/typing_extensions.py index efa09d55..c88d2a2f 100644 --- a/src/typing_extensions.py +++ b/src/typing_extensions.py @@ -2274,7 +2274,7 @@ def query(sql: LiteralString) -> ...: raise TypeError(f"{self} is not subscriptable") -if hasattr(typing, "Self"): # 3.11+ +if sys.version_info >= (3, 11): Self = typing.Self else: @_SpecialForm