from .schema import MetaData
from .type_api import _BindProcessorType
from .type_api import _ComparatorFactory
+ from .type_api import _LiteralProcessorType
from .type_api import _MatchedOnType
from .type_api import _ResultProcessorType
from ..engine.interfaces import Dialect
_integer = Integer()
_string = String()
- def string_bind_processor(self, dialect):
+ def string_bind_processor(
+ self, dialect: Dialect
+ ) -> Optional[_BindProcessorType[str]]:
return self._string._cached_bind_processor(dialect)
- def string_literal_processor(self, dialect):
+ def string_literal_processor(
+ self, dialect: Dialect
+ ) -> Optional[_LiteralProcessorType[str]]:
return self._string._cached_literal_processor(dialect)
- def bind_processor(self, dialect):
+ def bind_processor(self, dialect: Dialect) -> _BindProcessorType[Any]:
int_processor = self._integer._cached_bind_processor(dialect)
string_processor = self.string_bind_processor(dialect)
- def process(value):
+ def process(value: Optional[Any]) -> Any:
if int_processor and isinstance(value, int):
value = int_processor(value)
elif string_processor and isinstance(value, str):
return process
- def literal_processor(self, dialect):
+ def literal_processor(
+ self, dialect: Dialect
+ ) -> _LiteralProcessorType[Any]:
int_processor = self._integer._cached_literal_processor(dialect)
string_processor = self.string_literal_processor(dialect)
- def process(value):
+ def process(value: Optional[Any]) -> Any:
if int_processor and isinstance(value, int):
value = int_processor(value)
elif string_processor and isinstance(value, str):