1 2 3 4 5 6 7 8 9 10 11 12
from typing import Any from typing import Type from sqlalchemy.sql.elements import ColumnElement from sqlalchemy.sql.type_api import TypeEngine col: ColumnElement[Any] type_: Type[TypeEngine[Any]] obj: TypeEngine[Any] col.cast(type_) col.cast(obj)