@@ -172,6 +172,7 @@ class Enum(Emulated, String, SchemaType):
172
172
native_enum : bool = ...
173
173
create_constraint : bool = ...
174
174
validate_strings : bool = ...
175
+ enums : List [typing_Text ] = ... # This is set inside _setup_for_values.
175
176
def __init__ (self , * enums : Any , ** kw : Any ) -> None : ...
176
177
@property
177
178
def native (self ) -> bool : ...
@@ -243,7 +244,9 @@ class Interval(Emulated, _AbstractInterval[timedelta], TypeDecorator[timedelta])
243
244
def bind_processor (self , dialect : Dialect ) -> Callable [[Optional [timedelta ]], str ]: ...
244
245
def result_processor (self , dialect : Dialect , coltype : Any ) -> Callable [[Optional [str ]], Optional [timedelta ]]: ...
245
246
246
- class JSON (Indexable , TypeEngine [Dict [str , Any ]]):
247
+ _JSONT = Union [Dict [str , Any ], List [Any ]]
248
+
249
+ class JSON (Indexable , TypeEngine [_JSONT ]):
247
250
__visit_name__ : str = ...
248
251
hashable : bool = ...
249
252
NULL : util .symbol = ...
@@ -257,12 +260,13 @@ class JSON(Indexable, TypeEngine[Dict[str, Any]]):
257
260
class JSONIndexType (JSONElementType ): ...
258
261
class JSONPathType (JSONElementType ): ...
259
262
comparator_factory : Type [Any ] = ...
263
+ # This method returns `dict`, but it seems to be a bug in SQLAlchemy.
260
264
@property
261
265
def python_type (self ) -> Type [Dict [str , Any ]]: ...
262
266
@property
263
267
def should_evaluate_none (self ) -> bool : ... # type: ignore # incompatible with supertype "TypeEngine"
264
- def bind_processor (self , dialect : Dialect ) -> Callable [[Optional [Dict [ str , Any ] ]], Optional [str ]]: ...
265
- def result_processor (self , dialect : Dialect , coltype : Any ) -> Callable [[Optional [str ]], Optional [Dict [ str , Any ] ]]: ...
268
+ def bind_processor (self , dialect : Dialect ) -> Callable [[Optional [_JSONT ]], Optional [str ]]: ...
269
+ def result_processor (self , dialect : Dialect , coltype : Any ) -> Callable [[Optional [str ]], Optional [_JSONT ]]: ...
266
270
267
271
class ARRAY (Indexable , Concatenable , TypeEngine [List [_T ]]):
268
272
__visit_name__ : str = ...
0 commit comments