From 78f14247e8b5e27bea4b2e7fd97bdde4a79d8227 Mon Sep 17 00:00:00 2001
From: jakkdl
Date: Thu, 29 Oct 2026 17:14:53 +0100
Subject: [PATCH 1/2] [peewee] Annotate ColumnBase.__invert__
---
stubs/peewee/peewee.pyi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/stubs/peewee/peewee.pyi b/stubs/peewee/peewee.pyi
index 817ad6e5df1d..3a8618695b72 100644
--- a/stubs/peewee/peewee.pyi
+++ b/stubs/peewee/peewee.pyi
@@ -297,7 +297,7 @@ class ColumnBase(Node):
__pos__ = asc
def desc(self, collation=None, nulls=None) -> Ordering: ...
__neg__ = desc
- def __invert__(self): ...
+ def __invert__(self) -> ColumnBase: ...
__and__: ClassVar[Callable[[Self, Any], Expression]]
__or__: ClassVar[Callable[[Self, Any], Expression]]
def __add__(self, rhs: Any) -> Expression: ...
@@ -555,7 +555,7 @@ EXCLUDED: Incomplete
class DQ(ColumnBase):
query: Incomplete
def __init__(self, **query) -> None: ...
- def __invert__(self) -> Self: ... # type: ignore[override]
+ def __invert__(self) -> Self: ...
def clone(self) -> DQ: ...
Tuple: Incomplete
From a5356405e3ceeb213ee836d2647b1feea9eb9546 Mon Sep 17 00:00:00 2001
From: jakkdl
Date: Wed, 25 Nov 2026 12:32:01 +0100
Subject: [PATCH 2/2] [peewee] Return Negated from ColumnBase.__invert__
Co-Authored-By: Claude Opus 5.5
---
stubs/peewee/peewee.pyi | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/stubs/peewee/peewee.pyi b/stubs/peewee/peewee.pyi
index 3a8618695b72..256d37f4324c 100644
--- a/stubs/peewee/peewee.pyi
+++ b/stubs/peewee/peewee.pyi
@@ -297,7 +297,7 @@ class ColumnBase(Node):
__pos__ = asc
def desc(self, collation=None, nulls=None) -> Ordering: ...
__neg__ = desc
- def __invert__(self) -> ColumnBase: ...
+ def __invert__(self) -> Negated: ...
__and__: ClassVar[Callable[[Self, Any], Expression]]
__or__: ClassVar[Callable[[Self, Any], Expression]]
def __add__(self, rhs: Any) -> Expression: ...
@@ -555,7 +555,7 @@ EXCLUDED: Incomplete
class DQ(ColumnBase):
query: Incomplete
def __init__(self, **query) -> None: ...
- def __invert__(self) -> Self: ...
+ def __invert__(self) -> Self: ... # type: ignore[override]
def clone(self) -> DQ: ...
Tuple: Incomplete
@@ -1439,7 +1439,7 @@ class JSONField(FieldDatabaseHook, Field):
def has_keys(self, key_list) -> Expression: ...
def has_any_keys(self, key_list) -> Expression: ...
-class BitField(BitwiseMixin, BigIntegerField[_V]):
+class BitField(BitwiseMixin, BigIntegerField[_V]): # type: ignore[misc]
def __new__(cls, *args: Any, **kwargs: Unpack[_FieldKwargs]) -> BitField[int]: ...
def flag(self, value=None): ...