From: Mike Bayer Date: Wed, 8 Jul 2026 22:57:13 +0000 (-0400) Subject: update for mypy 2.2.0 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fb213ed536336a71759259a1ee15f021b1c7903c;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git update for mypy 2.2.0 Change-Id: I5478706dd47825bba38a87f81cd4e05e3e596a67 (cherry picked from commit 4009b58467c0f76d318a336894d754adb9ff4f74) --- diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py index b13839e0be..7d59633082 100644 --- a/lib/sqlalchemy/sql/elements.py +++ b/lib/sqlalchemy/sql/elements.py @@ -5313,7 +5313,7 @@ class quoted_name(util.MemoizedSlots, str): else: return quoted_name(value, quote) - def __new__(cls, value: str, quote: Optional[bool]) -> quoted_name: + def __new__(cls, value: str, quote: Optional[bool]) -> Self: assert ( value is not None ), "use quoted_name.construct() for None passthrough" @@ -5459,7 +5459,7 @@ class _truncated_label(quoted_name): __slots__ = () - def __new__(cls, value: str, quote: Optional[bool] = None) -> Any: + def __new__(cls, value: str, quote: Optional[bool] = None) -> Self: quote = getattr(value, "quote", quote) # return super(_truncated_label, cls).__new__(cls, value, quote, True) return super().__new__(cls, value, quote)