@@ -9,21 +9,28 @@ from typing import Union
9
9
10
10
from typing_extensions import Protocol
11
11
12
- from . import operators as operators
13
- from .base import SchemaEventTarget as SchemaEventTarget
14
- from .visitors import Traversible as Traversible
15
- from .visitors import TraversibleType as TraversibleType
16
- from .. import exc as exc
17
- from .. import util as util
12
+ from . import operators
13
+ from .base import SchemaEventTarget
14
+ from .elements import ClauseElement
15
+ from .sqltypes import Boolean
16
+ from .sqltypes import Indexable
17
+ from .sqltypes import Integer
18
+ from .sqltypes import MatchType
19
+ from .sqltypes import NullType
20
+ from .sqltypes import String
21
+ from .sqltypes import TableValueType
22
+ from .visitors import Traversible
23
+ from .visitors import TraversibleType
24
+ from .. import util
18
25
from ..util import compat
19
26
20
- BOOLEANTYPE : Any
21
- INTEGERTYPE : Any
22
- NULLTYPE : Any
23
- STRINGTYPE : Any
24
- MATCHTYPE : Any
25
- INDEXABLE : Any
26
- TABLEVALUE : Any
27
+ BOOLEANTYPE : Boolean
28
+ INTEGERTYPE : Integer
29
+ NULLTYPE : NullType
30
+ STRINGTYPE : String
31
+ MATCHTYPE : MatchType
32
+ INDEXABLE = Indexable
33
+ TABLEVALUE : TableValueType
27
34
28
35
_T = TypeVar ("_T" )
29
36
_T_co = TypeVar ("_T_co" , covariant = True )
@@ -45,17 +52,21 @@ class _ResultProcessor(Protocol[_T_co]):
45
52
def __call__ (self , __value : Optional [Any ]) -> Optional [_T_co ]: ...
46
53
47
54
class TypeEngine (Traversible , Generic [_T ]):
48
- class Comparator (operators .ColumnOperators ):
55
+ class Comparator (operators .ColumnOperators , Generic [ _TE ] ):
49
56
default_comparator : Any = ...
50
- def __clause_element__ (self ): ...
51
- expr : Any = ...
52
- type : Any = ...
53
- def __init__ (self , expr : Any ) -> None : ...
54
- def operate (self , op : Any , * other : Any , ** kwargs : Any ): ...
55
- def reverse_operate (self , op : Any , other : Any , ** kwargs : Any ): ...
56
- def __reduce__ (self ): ...
57
+ def __clause_element__ (self ) -> ClauseElement : ...
58
+ expr : ClauseElement = ...
59
+ type : _TE = ...
60
+ def __init__ (self , expr : ClauseElement ) -> None : ...
61
+ def operate (
62
+ self , op : Any , * other : Any , ** kwargs : Any
63
+ ) -> ClauseElement : ...
64
+ def reverse_operate (
65
+ self , op : Any , other : Any , ** kwargs : Any
66
+ ) -> ClauseElement : ...
67
+ def __reduce__ (self ) -> Any : ...
57
68
hashable : bool = ...
58
- comparator_factory : Type [Any ] = ...
69
+ comparator_factory : Type [Comparator [ TypeEngine [ _T ]] ] = ...
59
70
sort_key_function : Optional [compat ._SortKeyFunction ] = ...
60
71
should_evaluate_none : bool = ...
61
72
def evaluates_none (self : _TE ) -> _TE : ...
@@ -110,11 +121,15 @@ class TypeDecorator(SchemaEventTarget, TypeEngine[_T]):
110
121
impl : Any = ...
111
122
def __init__ (self , * args : Any , ** kwargs : Any ) -> None : ...
112
123
coerce_to_is_types : Tuple [Type [Any ], ...] = ...
113
- class Comparator (TypeEngine .Comparator ):
114
- def operate (self , op : Any , * other : Any , ** kwargs : Any ): ...
115
- def reverse_operate (self , op : Any , other : Any , ** kwargs : Any ): ...
124
+ class Comparator (TypeEngine .Comparator [_TE ]):
125
+ def operate (
126
+ self , op : Any , * other : Any , ** kwargs : Any
127
+ ) -> ClauseElement : ...
128
+ def reverse_operate (
129
+ self , op : Any , other : Any , ** kwargs : Any
130
+ ) -> ClauseElement : ...
116
131
@property
117
- def comparator_factory (self ) -> Type [Any ]: ... # type: ignore[override]
132
+ def comparator_factory (self ) -> Type [Comparator [ TypeEngine [ _T ]] ]: ... # type: ignore[override]
118
133
def type_engine (self , dialect : Any ) -> TypeEngine [Any ]: ...
119
134
def load_dialect_impl (self , dialect : Any ) -> TypeEngine [Any ]: ...
120
135
def __getattr__ (self , key : Any ) -> Any : ...
@@ -155,5 +170,5 @@ class Variant(TypeDecorator[_T]):
155
170
@property
156
171
def comparator_factory (self ) -> Type [Any ]: ... # type: ignore[override]
157
172
158
- def to_instance (typeobj : Any , * arg : Any , ** kw : Any ): ...
159
- def adapt_type (typeobj : Any , colspecs : Any ): ...
173
+ def to_instance (typeobj : Any , * arg : Any , ** kw : Any ) -> Any : ...
174
+ def adapt_type (typeobj : Any , colspecs : Any ) -> Any : ...
0 commit comments