1
- from operator import truediv
1
+ from operator import add as add
2
+ from operator import and_ as and_
3
+ from operator import contains as contains
4
+ from operator import eq as eq
5
+ from operator import ge as ge
6
+ from operator import getitem as getitem
7
+ from operator import gt as gt
8
+ from operator import inv as inv
9
+ from operator import le as le
10
+ from operator import lshift as lshift
11
+ from operator import lt as lt
12
+ from operator import mod as mod
13
+ from operator import mul as mul
14
+ from operator import ne as ne
15
+ from operator import neg as neg
16
+ from operator import or_ as or_
17
+ from operator import rshift as rshift
18
+ from operator import sub as sub
19
+ from operator import truediv as truediv
2
20
from typing import Any
21
+ from typing import Callable
3
22
from typing import Optional
23
+ from typing import Type
24
+ from typing import TypeVar
25
+ from typing import Union
4
26
5
- from .. import util as util
27
+ from .elements import ClauseElement
28
+ from .type_api import TypeEngine
29
+
30
+ _F = TypeVar ("_F" , bound = Callable [..., Any ])
6
31
7
32
div = truediv
8
33
9
34
class Operators :
10
- def __and__ (self , other : Any ): ...
11
- def __or__ (self , other : Any ): ...
12
- def __invert__ (self ): ...
35
+ def __and__ (self , other : Any ) -> ClauseElement : ...
36
+ def __or__ (self , other : Any ) -> ClauseElement : ...
37
+ def __invert__ (self ) -> ClauseElement : ...
13
38
def op (
14
39
self ,
15
40
opstring : Any ,
16
41
precedence : int = ...,
17
42
is_comparison : bool = ...,
18
- return_type : Optional [Any ] = ...,
19
- ): ...
20
- def bool_op (self , opstring : Any , precedence : int = ...): ...
21
- def operate (self , op : Any , * other : Any , ** kwargs : Any ) -> None : ...
22
- def reverse_operate (self , op : Any , other : Any , ** kwargs : Any ) -> None : ...
43
+ return_type : Optional [
44
+ Union [Type [TypeEngine [Any ]], TypeEngine [Any ]]
45
+ ] = ...,
46
+ ) -> Callable [[Any ], ClauseElement ]: ...
47
+ def bool_op (
48
+ self , opstring : Any , precedence : int = ...
49
+ ) -> Callable [[Any ], ClauseElement ]: ...
50
+ def operate (
51
+ self , op : Any , * other : Any , ** kwargs : Any
52
+ ) -> ClauseElement : ...
53
+ def reverse_operate (
54
+ self , op : Any , other : Any , ** kwargs : Any
55
+ ) -> ClauseElement : ...
23
56
24
57
class custom_op :
25
58
__name__ : str = ...
26
59
opstring : Any = ...
27
- precedence : Any = ...
28
- is_comparison : Any = ...
29
- natural_self_precedent : Any = ...
30
- eager_grouping : Any = ...
31
- return_type : Any = ...
60
+ precedence : int = ...
61
+ is_comparison : bool = ...
62
+ natural_self_precedent : bool = ...
63
+ eager_grouping : bool = ...
64
+ return_type : Optional [ Union [ Type [ TypeEngine [ Any ]], TypeEngine [ Any ]]] = ...
32
65
def __init__ (
33
66
self ,
34
67
opstring : Any ,
35
68
precedence : int = ...,
36
69
is_comparison : bool = ...,
37
- return_type : Optional [Any ] = ...,
70
+ return_type : Optional [
71
+ Union [Type [TypeEngine [Any ]], TypeEngine [Any ]]
72
+ ] = ...,
38
73
natural_self_precedent : bool = ...,
39
74
eager_grouping : bool = ...,
40
75
) -> None : ...
41
- def __eq__ (self , other : Any ) -> Any : ...
42
- def __hash__ (self ) -> Any : ...
43
- def __call__ (self , left : Any , right : Any , ** kw : Any ): ...
76
+ def __eq__ (self , other : Any ) -> bool : ...
77
+ def __hash__ (self ) -> int : ...
78
+ def __call__ (self , left : Any , right : Any , ** kw : Any ) -> ClauseElement : ...
44
79
45
80
class ColumnOperators (Operators ):
46
81
timetuple : Any = ...
47
- def __lt__ (self , other : Any ) -> Any : ...
48
- def __le__ (self , other : Any ) -> Any : ...
49
- __hash__ : Any = ...
50
- def __eq__ (self , other : Any ) -> Any : ...
51
- def __ne__ (self , other : Any ) -> Any : ...
52
- def is_distinct_from (self , other : Any ): ...
53
- def is_not_distinct_from (self , other : Any ): ...
54
- isnot_distinct_from : Any = ...
55
- def __gt__ (self , other : Any ) -> Any : ...
56
- def __ge__ (self , other : Any ) -> Any : ...
57
- def __neg__ (self ): ...
58
- def __contains__ (self , other : Any ): ...
59
- def __getitem__ (self , index : Any ): ...
60
- def __lshift__ (self , other : Any ): ...
61
- def __rshift__ (self , other : Any ): ...
62
- def concat (self , other : Any ): ...
63
- def like (self , other : Any , escape : Optional [Any ] = ...): ...
64
- def ilike (self , other : Any , escape : Optional [Any ] = ...): ...
65
- def in_ (self , other : Any ): ...
66
- def not_in (self , other : Any ): ...
67
- notin_ : Any = ...
68
- def not_like (self , other : Any , escape : Optional [Any ] = ...): ...
69
- notlike : Any = ...
70
- def not_ilike (self , other : Any , escape : Optional [Any ] = ...): ...
71
- notilike : Any = ...
72
- def is_ (self , other : Any ): ...
73
- def is_not (self , other : Any ): ...
82
+ def __lt__ (self , other : Any ) -> ClauseElement : ...
83
+ def __le__ (self , other : Any ) -> ClauseElement : ...
84
+ def __eq__ (self , other : Any ) -> ClauseElement : ... # type: ignore[override]
85
+ def __ne__ (self , other : Any ) -> ClauseElement : ... # type: ignore[override]
86
+ def is_distinct_from (self , other : Any ) -> ClauseElement : ...
87
+ def is_not_distinct_from (self , other : Any ) -> ClauseElement : ...
88
+ def isnot_distinct_from (self , other : Any ) -> ClauseElement : ...
89
+ def __gt__ (self , other : Any ) -> ClauseElement : ...
90
+ def __ge__ (self , other : Any ) -> ClauseElement : ...
91
+ def __neg__ (self ) -> ClauseElement : ...
92
+ def __contains__ (self , other : Any ) -> ClauseElement : ...
93
+ def __getitem__ (self , index : Any ) -> ClauseElement : ...
94
+ def __lshift__ (self , other : Any ) -> ClauseElement : ...
95
+ def __rshift__ (self , other : Any ) -> ClauseElement : ...
96
+ def concat (self , other : Any ) -> ClauseElement : ...
97
+ def like (
98
+ self , other : Any , escape : Optional [Any ] = ...
99
+ ) -> ClauseElement : ...
100
+ def ilike (
101
+ self , other : Any , escape : Optional [Any ] = ...
102
+ ) -> ClauseElement : ...
103
+ def in_ (self , other : Any ) -> ClauseElement : ...
104
+ def not_in (self , other : Any ) -> ClauseElement : ...
105
+ def notin_ (self , other : Any ) -> ClauseElement : ...
106
+ def not_like (
107
+ self , other : Any , escape : Optional [Any ] = ...
108
+ ) -> ClauseElement : ...
109
+ def notlike (
110
+ self , other : Any , escape : Optional [Any ] = ...
111
+ ) -> ClauseElement : ...
112
+ def not_ilike (
113
+ self , other : Any , escape : Optional [Any ] = ...
114
+ ) -> ClauseElement : ...
115
+ def notilike (
116
+ self , other : Any , escape : Optional [Any ] = ...
117
+ ) -> ClauseElement : ...
118
+ def is_ (self , other : Any ) -> ClauseElement : ...
119
+ def is_not (self , other : Any ) -> ClauseElement : ...
74
120
isnot : Any = ...
75
- def startswith (self , other : Any , ** kwargs : Any ): ...
76
- def endswith (self , other : Any , ** kwargs : Any ): ...
77
- def contains (self , other : Any , ** kwargs : Any ): ...
78
- def match (self , other : Any , ** kwargs : Any ): ...
79
- def regexp_match (self , pattern : Any , flags : Optional [Any ] = ...): ...
121
+ def startswith (self , other : Any , ** kwargs : Any ) -> ClauseElement : ...
122
+ def endswith (self , other : Any , ** kwargs : Any ) -> ClauseElement : ...
123
+ def contains (self , other : Any , ** kwargs : Any ) -> ClauseElement : ...
124
+ def match (self , other : Any , ** kwargs : Any ) -> ClauseElement : ...
125
+ def regexp_match (
126
+ self , pattern : Any , flags : Optional [Any ] = ...
127
+ ) -> ClauseElement : ...
80
128
def regexp_replace (
81
129
self , pattern : Any , replacement : Any , flags : Optional [Any ] = ...
82
- ): ...
83
- def desc (self ): ...
84
- def asc (self ): ...
85
- def nulls_first (self ): ...
86
- nullsfirst : Any = ...
87
- def nulls_last (self ): ...
88
- nullslast : Any = ...
89
- def collate (self , collation : Any ): ...
90
- def __radd__ (self , other : Any ): ...
91
- def __rsub__ (self , other : Any ): ...
92
- def __rmul__ (self , other : Any ): ...
93
- def __rdiv__ (self , other : Any ): ...
94
- def __rmod__ (self , other : Any ): ...
95
- def between (self , cleft : Any , cright : Any , symmetric : bool = ...): ...
96
- def distinct (self ): ...
97
- def any_ (self ): ...
98
- def all_ (self ): ...
99
- def __add__ (self , other : Any ): ...
100
- def __sub__ (self , other : Any ): ...
101
- def __mul__ (self , other : Any ): ...
102
- def __div__ (self , other : Any ): ...
103
- def __mod__ (self , other : Any ): ...
104
- def __truediv__ (self , other : Any ): ...
105
- def __rtruediv__ (self , other : Any ): ...
106
-
107
- def commutative_op (fn : Any ): ...
108
- def comparison_op (fn : Any ): ...
130
+ ) -> ClauseElement : ...
131
+ def desc (self ) -> ClauseElement : ...
132
+ def asc (self ) -> ClauseElement : ...
133
+ def nulls_first (self ) -> ClauseElement : ...
134
+ def nullsfirst (self ) -> ClauseElement : ...
135
+ def nulls_last (self ) -> ClauseElement : ...
136
+ def nullslast (self ) -> ClauseElement : ...
137
+ def collate (self , collation : Any ) -> ClauseElement : ...
138
+ def __radd__ (self , other : Any ) -> ClauseElement : ...
139
+ def __rsub__ (self , other : Any ) -> ClauseElement : ...
140
+ def __rmul__ (self , other : Any ) -> ClauseElement : ...
141
+ def __rdiv__ (self , other : Any ) -> ClauseElement : ...
142
+ def __rmod__ (self , other : Any ) -> ClauseElement : ...
143
+ def between (
144
+ self , cleft : Any , cright : Any , symmetric : bool = ...
145
+ ) -> ClauseElement : ...
146
+ def distinct (self ) -> ClauseElement : ...
147
+ def any_ (self ) -> ClauseElement : ...
148
+ def all_ (self ) -> ClauseElement : ...
149
+ def __add__ (self , other : Any ) -> ClauseElement : ...
150
+ def __sub__ (self , other : Any ) -> ClauseElement : ...
151
+ def __mul__ (self , other : Any ) -> ClauseElement : ...
152
+ def __div__ (self , other : Any ) -> ClauseElement : ...
153
+ def __mod__ (self , other : Any ) -> ClauseElement : ...
154
+ def __truediv__ (self , other : Any ) -> ClauseElement : ...
155
+ def __rtruediv__ (self , other : Any ) -> ClauseElement : ...
156
+
157
+ def commutative_op (fn : _F ) -> _F : ...
158
+ def comparison_op (fn : _F ) -> _F : ...
109
159
def from_ () -> None : ...
110
160
def function_as_comparison_op () -> None : ...
111
161
def as_ () -> None : ...
@@ -118,98 +168,110 @@ def is_false(a: Any) -> None: ...
118
168
119
169
isfalse = is_false
120
170
121
- def is_distinct_from (a : Any , b : Any ): ...
122
- def is_not_distinct_from (a : Any , b : Any ): ...
171
+ def is_distinct_from (a : Any , b : Any ) -> ClauseElement : ...
172
+ def is_not_distinct_from (a : Any , b : Any ) -> ClauseElement : ...
123
173
124
174
isnot_distinct_from = is_not_distinct_from
125
175
126
- def is_ (a : Any , b : Any ): ...
127
- def is_not (a : Any , b : Any ): ...
176
+ def is_ (a : Any , b : Any ) -> ClauseElement : ...
177
+ def is_not (a : Any , b : Any ) -> ClauseElement : ...
128
178
129
179
isnot = is_not
130
180
131
- def collate (a : Any , b : Any ): ...
132
- def op (a : Any , opstring : Any , b : Any ): ...
133
- def like_op (a : Any , b : Any , escape : Optional [Any ] = ...): ...
134
- def not_like_op (a : Any , b : Any , escape : Optional [Any ] = ...): ...
181
+ def collate (a : Any , b : Any ) -> ClauseElement : ...
182
+ def op (a : Any , opstring : str , b : Any ) -> ClauseElement : ...
183
+ def like_op (a : Any , b : Any , escape : Optional [Any ] = ...) -> ClauseElement : ...
184
+ def not_like_op (
185
+ a : Any , b : Any , escape : Optional [Any ] = ...
186
+ ) -> ClauseElement : ...
135
187
136
188
notlike_op = not_like_op
137
189
138
- def ilike_op (a : Any , b : Any , escape : Optional [Any ] = ...): ...
139
- def not_ilike_op (a : Any , b : Any , escape : Optional [Any ] = ...): ...
190
+ def ilike_op (a : Any , b : Any , escape : Optional [Any ] = ...) -> ClauseElement : ...
191
+ def not_ilike_op (
192
+ a : Any , b : Any , escape : Optional [Any ] = ...
193
+ ) -> ClauseElement : ...
140
194
141
195
notilike_op = not_ilike_op
142
196
143
- def between_op (a : Any , b : Any , c : Any , symmetric : bool = ...): ...
144
- def not_between_op (a : Any , b : Any , c : Any , symmetric : bool = ...): ...
197
+ def between_op (
198
+ a : Any , b : Any , c : Any , symmetric : bool = ...
199
+ ) -> ClauseElement : ...
200
+ def not_between_op (
201
+ a : Any , b : Any , c : Any , symmetric : bool = ...
202
+ ) -> ClauseElement : ...
145
203
146
204
notbetween_op = not_between_op
147
205
148
- def in_op (a : Any , b : Any ): ...
149
- def not_in_op (a : Any , b : Any ): ...
206
+ def in_op (a : Any , b : Any ) -> ClauseElement : ...
207
+ def not_in_op (a : Any , b : Any ) -> ClauseElement : ...
150
208
151
209
notin_op = not_in_op
152
210
153
- def distinct_op (a : Any ): ...
154
- def any_op (a : Any ): ...
155
- def all_op (a : Any ): ...
211
+ def distinct_op (a : Any ) -> ClauseElement : ...
212
+ def any_op (a : Any ) -> ClauseElement : ...
213
+ def all_op (a : Any ) -> ClauseElement : ...
156
214
def startswith_op (
157
215
a : Any , b : Any , escape : Optional [Any ] = ..., autoescape : bool = ...
158
- ): ...
216
+ ) -> ClauseElement : ...
159
217
def not_startswith_op (
160
218
a : Any , b : Any , escape : Optional [Any ] = ..., autoescape : bool = ...
161
- ): ...
219
+ ) -> ClauseElement : ...
162
220
163
221
notstartswith_op = not_startswith_op
164
222
165
223
def endswith_op (
166
224
a : Any , b : Any , escape : Optional [Any ] = ..., autoescape : bool = ...
167
- ): ...
225
+ ) -> ClauseElement : ...
168
226
def not_endswith_op (
169
227
a : Any , b : Any , escape : Optional [Any ] = ..., autoescape : bool = ...
170
- ): ...
228
+ ) -> ClauseElement : ...
171
229
172
230
notendswith_op = not_endswith_op
173
231
174
232
def contains_op (
175
233
a : Any , b : Any , escape : Optional [Any ] = ..., autoescape : bool = ...
176
- ): ...
234
+ ) -> ClauseElement : ...
177
235
def not_contains_op (
178
236
a : Any , b : Any , escape : Optional [Any ] = ..., autoescape : bool = ...
179
- ): ...
237
+ ) -> ClauseElement : ...
180
238
181
239
notcontains_op = not_contains_op
182
240
183
- def match_op (a : Any , b : Any , ** kw : Any ): ...
184
- def regexp_match_op (a : Any , b : Any , flags : Optional [Any ] = ...): ...
185
- def not_regexp_match_op (a : Any , b : Any , flags : Optional [Any ] = ...): ...
241
+ def match_op (a : Any , b : Any , ** kw : Any ) -> ClauseElement : ...
242
+ def regexp_match_op (
243
+ a : Any , b : Any , flags : Optional [Any ] = ...
244
+ ) -> ClauseElement : ...
245
+ def not_regexp_match_op (
246
+ a : Any , b : Any , flags : Optional [Any ] = ...
247
+ ) -> ClauseElement : ...
186
248
def regexp_replace_op (
187
249
a : Any , b : Any , replacement : Any , flags : Optional [Any ] = ...
188
- ): ...
189
- def not_match_op (a : Any , b : Any , ** kw : Any ): ...
250
+ ) -> ClauseElement : ...
251
+ def not_match_op (a : Any , b : Any , ** kw : Any ) -> ClauseElement : ...
190
252
191
253
notmatch_op = not_match_op
192
254
193
255
def comma_op (a : Any , b : Any ) -> None : ...
194
256
def filter_op (a : Any , b : Any ) -> None : ...
195
- def concat_op (a : Any , b : Any ): ...
196
- def desc_op (a : Any ): ...
197
- def asc_op (a : Any ): ...
198
- def nulls_first_op (a : Any ): ...
257
+ def concat_op (a : Any , b : Any ) -> ClauseElement : ...
258
+ def desc_op (a : Any ) -> ClauseElement : ...
259
+ def asc_op (a : Any ) -> ClauseElement : ...
260
+ def nulls_first_op (a : Any ) -> ClauseElement : ...
199
261
200
262
nullsfirst_op = nulls_first_op
201
263
202
- def nulls_last_op (a : Any ): ...
264
+ def nulls_last_op (a : Any ) -> ClauseElement : ...
203
265
204
266
nullslast_op = nulls_last_op
205
267
206
268
def json_getitem_op (a : Any , b : Any ) -> None : ...
207
269
def json_path_getitem_op (a : Any , b : Any ) -> None : ...
208
- def is_comparison (op : Any ): ...
209
- def is_commutative (op : Any ): ...
210
- def is_ordering_modifier (op : Any ): ...
211
- def is_natural_self_precedent (op : Any ): ...
212
- def is_boolean (op : Any ): ...
213
- def mirror (op : Any ): ...
214
- def is_associative (op : Any ): ...
215
- def is_precedent (operator : Any , against : Any ): ...
270
+ def is_comparison (op : Any ) -> bool : ...
271
+ def is_commutative (op : Any ) -> bool : ...
272
+ def is_ordering_modifier (op : Any ) -> bool : ...
273
+ def is_natural_self_precedent (op : Any ) -> bool : ...
274
+ def is_boolean (op : Any ) -> bool : ...
275
+ def mirror (op : Any ) -> Any : ...
276
+ def is_associative (op : Any ) -> bool : ...
277
+ def is_precedent (operator : Any , against : Any ) -> bool : ...
0 commit comments