MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / to_decimal_processor_factory

Class to_decimal_processor_factory

lib/sqlalchemy/engine/_processors_cy.py:78–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76
77@cython.cclass
78class to_decimal_processor_factory:
79 type_: type
80 format_: str
81
82 __slots__ = ("type_", "format_")
83
84 def __init__(self, type_: type, scale: int):
85 self.type_ = type_
86 self.format_ = f"%.{scale}f"
87
88 def __call__(self, value: Optional[Any]) -> object:
89 if value is None:
90 return None
91 else:
92 return self.type_(self.format_ % value)

Callers 1

goMethod · 0.90

Calls

no outgoing calls

Tested by 1

goMethod · 0.72