@@ -9,21 +9,29 @@ 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
25
+ from ..engine import Dialect
18
26
from ..util import compat
19
27
20
- BOOLEANTYPE : Any
21
- INTEGERTYPE : Any
22
- NULLTYPE : Any
23
- STRINGTYPE : Any
24
- MATCHTYPE : Any
25
- INDEXABLE : Any
26
- TABLEVALUE : Any
28
+ BOOLEANTYPE : Boolean
29
+ INTEGERTYPE : Integer
30
+ NULLTYPE : NullType
31
+ STRINGTYPE : String
32
+ MATCHTYPE : MatchType
33
+ INDEXABLE = Indexable
34
+ TABLEVALUE : TableValueType
27
35
28
36
_T = TypeVar ("_T" )
29
37
_T_co = TypeVar ("_T_co" , covariant = True )
@@ -45,29 +53,37 @@ class _ResultProcessor(Protocol[_T_co]):
45
53
def __call__ (self , __value : Optional [Any ]) -> Optional [_T_co ]: ...
46
54
47
55
class TypeEngine (Traversible , Generic [_T ]):
48
- class Comparator (operators .ColumnOperators ):
56
+ class Comparator (operators .ColumnOperators , Generic [ _TE ] ):
49
57
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 ): ...
58
+ def __clause_element__ (self ) -> ClauseElement : ...
59
+ expr : ClauseElement = ...
60
+ type : _TE = ...
61
+ def __init__ (self , expr : ClauseElement ) -> None : ...
62
+ def operate (
63
+ self , op : Any , * other : Any , ** kwargs : Any
64
+ ) -> ClauseElement : ...
65
+ def reverse_operate (
66
+ self , op : Any , other : Any , ** kwargs : Any
67
+ ) -> ClauseElement : ...
68
+ def __reduce__ (self ) -> Any : ...
57
69
hashable : bool = ...
58
- comparator_factory : Type [Any ] = ...
70
+ comparator_factory : Type [Comparator [ TypeEngine [ _T ]] ] = ...
59
71
sort_key_function : Optional [compat ._SortKeyFunction ] = ...
60
72
should_evaluate_none : bool = ...
61
73
def evaluates_none (self : _TE ) -> _TE : ...
62
74
def copy (self : _TE , ** kw : Any ) -> _TE : ...
63
- def compare_against_backend (self , dialect : Any , conn_type : Any ) -> Any : ...
75
+ def compare_against_backend (
76
+ self , dialect : Dialect , conn_type : Any
77
+ ) -> Any : ...
64
78
def copy_value (self , value : _T ) -> _T : ...
65
79
def literal_processor (
66
- self , dialect : Any
80
+ self , dialect : Dialect
67
81
) -> Optional [_LiteralProcessor [_T ]]: ...
68
- def bind_processor (self , dialect : Any ) -> Optional [_BindProcessor [_T ]]: ...
82
+ def bind_processor (
83
+ self , dialect : Dialect
84
+ ) -> Optional [_BindProcessor [_T ]]: ...
69
85
def result_processor (
70
- self , dialect : Any , coltype : Any
86
+ self , dialect : Dialect , coltype : Any
71
87
) -> Optional [_ResultProcessor [_T ]]: ...
72
88
def column_expression (self , colexpr : Any ) -> Any : ...
73
89
def bind_expression (self , bindvalue : Any ) -> Any : ...
@@ -79,12 +95,12 @@ class TypeEngine(Traversible, Generic[_T]):
79
95
self , type_ : Type [TypeEngine [_U ]], dialect_name : str
80
96
) -> Variant [_U ]: ...
81
97
def as_generic (self , allow_nulltype : bool = ...) -> TypeEngine [Any ]: ...
82
- def dialect_impl (self , dialect : Any ) -> Type [Any ]: ...
98
+ def dialect_impl (self , dialect : Dialect ) -> Type [Any ]: ...
83
99
def adapt (self , __cls : Type [_U ], ** kw : Any ) -> _U : ...
84
100
def coerce_compared_value (
85
101
self , op : Any , value : Any
86
102
) -> TypeEngine [Any ]: ...
87
- def compile (self , dialect : Optional [Any ] = ...) -> Any : ...
103
+ def compile (self , dialect : Optional [Dialect ] = ...) -> Any : ...
88
104
89
105
class VisitableCheckKWArg (util .EnsureKWArgType , TraversibleType ): ...
90
106
@@ -110,25 +126,31 @@ class TypeDecorator(SchemaEventTarget, TypeEngine[_T]):
110
126
impl : Any = ...
111
127
def __init__ (self , * args : Any , ** kwargs : Any ) -> None : ...
112
128
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 ): ...
129
+ class Comparator (TypeEngine .Comparator [_TE ]):
130
+ def operate (
131
+ self , op : Any , * other : Any , ** kwargs : Any
132
+ ) -> ClauseElement : ...
133
+ def reverse_operate (
134
+ self , op : Any , other : Any , ** kwargs : Any
135
+ ) -> ClauseElement : ...
116
136
@property
117
- def comparator_factory (self ) -> Type [Any ]: ... # type: ignore[override]
118
- def type_engine (self , dialect : Any ) -> TypeEngine [Any ]: ...
119
- def load_dialect_impl (self , dialect : Any ) -> TypeEngine [Any ]: ...
137
+ def comparator_factory (self ) -> Type [Comparator [ TypeEngine [ _T ]] ]: ... # type: ignore[override]
138
+ def type_engine (self , dialect : Dialect ) -> TypeEngine [Any ]: ...
139
+ def load_dialect_impl (self , dialect : Dialect ) -> TypeEngine [Any ]: ...
120
140
def __getattr__ (self , key : Any ) -> Any : ...
121
141
def process_literal_param (
122
- self , value : Optional [_T ], dialect : Any
142
+ self , value : Optional [_T ], dialect : Dialect
123
143
) -> str : ...
124
- def process_bind_param (self , value : Optional [_T ], dialect : Any ) -> Any : ...
144
+ def process_bind_param (
145
+ self , value : Optional [_T ], dialect : Dialect
146
+ ) -> Any : ...
125
147
def process_result_value (
126
- self , value : Any , dialect : Any
148
+ self , value : Any , dialect : Dialect
127
149
) -> Optional [_T ]: ...
128
- def literal_processor (self , dialect : Any ) -> _LiteralProcessor [_T ]: ...
129
- def bind_processor (self , dialect : Any ) -> _BindProcessor [_T ]: ...
150
+ def literal_processor (self , dialect : Dialect ) -> _LiteralProcessor [_T ]: ...
151
+ def bind_processor (self , dialect : Dialect ) -> _BindProcessor [_T ]: ...
130
152
def result_processor (
131
- self , dialect : Any , coltype : Any
153
+ self , dialect : Dialect , coltype : Any
132
154
) -> _ResultProcessor [_T ]: ...
133
155
def bind_expression (self , bindparam : Any ) -> Any : ...
134
156
def column_expression (self , column : Any ) -> Any : ...
@@ -148,12 +170,12 @@ class Variant(TypeDecorator[_T]):
148
170
def coerce_compared_value (
149
171
self : _VT , operator : Any , value : Any
150
172
) -> Union [_VT , TypeEngine [Any ]]: ...
151
- def load_dialect_impl (self , dialect : Any ) -> TypeEngine [Any ]: ...
173
+ def load_dialect_impl (self , dialect : Dialect ) -> TypeEngine [Any ]: ...
152
174
def with_variant (
153
175
self , type_ : Type [TypeEngine [_U ]], dialect_name : str
154
176
) -> Variant [_U ]: ...
155
177
@property
156
178
def comparator_factory (self ) -> Type [Any ]: ... # type: ignore[override]
157
179
158
- def to_instance (typeobj : Any , * arg : Any , ** kw : Any ): ...
159
- def adapt_type (typeobj : Any , colspecs : Any ): ...
180
+ def to_instance (typeobj : Any , * arg : Any , ** kw : Any ) -> Any : ...
181
+ def adapt_type (typeobj : Any , colspecs : Any ) -> Any : ...
0 commit comments