1- from collections .abc import Iterable , Mapping
2- from typing import Any , Generic , Literal , TypeVar
1+ from collections .abc import Iterable
2+ from typing import Any , Generic , Literal , Sequence , TypeVar
33
44from django .core .exceptions import EmptyResultSet
55from django .db .backends .base .base import BaseDatabaseWrapper
6- from django .db .models .expressions import Expression , Func
6+ from django .db .models .expressions import Combinable , Expression , Func
77from django .db .models .fields import BooleanField
88from django .db .models .query_utils import RegisterLookupMixin
99from django .db .models .sql .compiler import SQLCompiler , _AsSqlType , _ParamT
1010from django .utils .datastructures import OrderedSet
1111from django .utils .functional import cached_property
12- from typing_extensions import Self
1312
1413_T = TypeVar ("_T" )
1514
16- class Lookup (Generic [_T ]):
15+ class Lookup (Expression , Generic [_T ]):
1716 lookup_name : str
1817 prepare_rhs : bool
1918 can_use_none_as_rhs : bool
@@ -26,16 +25,14 @@ class Lookup(Generic[_T]):
2625 self , compiler : SQLCompiler , connection : BaseDatabaseWrapper , rhs : OrderedSet | None = ...
2726 ) -> tuple [list [str ], list [str ]]: ...
2827 def get_source_expressions (self ) -> list [Expression ]: ...
29- def set_source_expressions (self , new_exprs : list [ Expression ]) -> None : ...
28+ def set_source_expressions (self , new_exprs : Sequence [ Combinable | Expression ]) -> None : ...
3029 def get_prep_lookup (self ) -> Any : ...
3130 def get_db_prep_lookup (self , value : _ParamT , connection : BaseDatabaseWrapper ) -> _AsSqlType : ...
3231 def process_lhs (
3332 self , compiler : SQLCompiler , connection : BaseDatabaseWrapper , lhs : Expression | None = ...
3433 ) -> _AsSqlType : ...
3534 def process_rhs (self , compiler : SQLCompiler , connection : BaseDatabaseWrapper ) -> _AsSqlType : ...
3635 def rhs_is_direct_value (self ) -> bool : ...
37- def relabeled_clone (self , relabels : Mapping [str , str ]) -> Self : ...
38- def get_group_by_cols (self ) -> list [Expression ]: ...
3936 def as_sql (self , compiler : SQLCompiler , connection : BaseDatabaseWrapper ) -> _AsSqlType : ...
4037 def as_oracle (self , compiler : SQLCompiler , connection : BaseDatabaseWrapper ) -> _AsSqlType : ...
4138 @cached_property
@@ -45,8 +42,6 @@ class Lookup(Generic[_T]):
4542 @cached_property
4643 def contains_over_clause (self ) -> bool : ...
4744 @property
48- def is_summary (self ) -> bool : ...
49- @property
5045 def identity (self ) -> tuple [type [Lookup ], Any , Any ]: ...
5146
5247class Transform (RegisterLookupMixin , Func ):
0 commit comments