MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / visit_truediv_binary

Method visit_truediv_binary

lib/sqlalchemy/sql/compiler.py:3149–3174  ·  view source on GitHub ↗
(self, binary, operator, **kw)

Source from the content-addressed store, hash-verified

3147 )
3148
3149 def visit_truediv_binary(self, binary, operator, **kw):
3150 if self.dialect.div_is_floordiv:
3151 return (
3152 self.process(binary.left, **kw)
3153 + " / "
3154 # TODO: would need a fast cast again here,
3155 # unless we want to use an implicit cast like "+ 0.0"
3156 + self.process(
3157 elements.Cast(
3158 binary.right,
3159 (
3160 binary.right.type
3161 if binary.right.type._type_affinity
3162 is sqltypes.Numeric
3163 else sqltypes.Numeric()
3164 ),
3165 ),
3166 **kw,
3167 )
3168 )
3169 else:
3170 return (
3171 self.process(binary.left, **kw)
3172 + " / "
3173 + self.process(binary.right, **kw)
3174 )
3175
3176 def visit_floordiv_binary(self, binary, operator, **kw):
3177 if (

Callers

nothing calls this directly

Calls 1

processMethod · 0.45

Tested by

no test coverage detected