MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / visit_truediv_binary

Method visit_truediv_binary

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

Source from the content-addressed store, hash-verified

3301 )
3302
3303 def visit_truediv_binary(self, binary, operator, **kw):
3304 if self.dialect.div_is_floordiv:
3305 return (
3306 self.process(binary.left, **kw)
3307 + " / "
3308 # TODO: would need a fast cast again here,
3309 # unless we want to use an implicit cast like "+ 0.0"
3310 + self.process(
3311 elements.Cast(
3312 binary.right,
3313 (
3314 binary.right.type
3315 if binary.right.type._type_affinity
3316 in (sqltypes.Numeric, sqltypes.Float)
3317 else sqltypes.Numeric()
3318 ),
3319 ),
3320 **kw,
3321 )
3322 )
3323 else:
3324 return (
3325 self.process(binary.left, **kw)
3326 + " / "
3327 + self.process(binary.right, **kw)
3328 )
3329
3330 def visit_floordiv_binary(self, binary, operator, **kw):
3331 if (

Callers

nothing calls this directly

Calls 1

processMethod · 0.45

Tested by

no test coverage detected