From 42347a1adafe374e556f0891b4ee8e4e1097b00f Mon Sep 17 00:00:00 2001 From: vidhyavijayan3 <149491240+vidhyavijayan3@users.noreply.github.com> Date: Mon, 28 Apr 2025 17:14:40 +0530 Subject: [PATCH] Fix base class compatibility for IntFlag in Python 3.11+ to resolve inverted type issue (#13854) --- stdlib/enum.pyi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/enum.pyi b/stdlib/enum.pyi index 8c88b26a3..26f198867 100644 --- a/stdlib/enum.pyi +++ b/stdlib/enum.pyi @@ -299,6 +299,7 @@ if sys.version_info >= (3, 11): def __or__(self, other: int) -> Self: ... def __and__(self, other: int) -> Self: ... def __xor__(self, other: int) -> Self: ... + def __invert__(self) -> Self: ... __ror__ = __or__ __rand__ = __and__ __rxor__ = __xor__ @@ -309,6 +310,7 @@ else: def __or__(self, other: int) -> Self: ... def __and__(self, other: int) -> Self: ... def __xor__(self, other: int) -> Self: ... + def __invert__(self) -> Self: ... __ror__ = __or__ __rand__ = __and__ __rxor__ = __xor__