MCPcopy Create free account
hub / github.com/python/mypy / visit_cast

Method visit_cast

mypyc/ir/pprint.py:199–206  ·  view source on GitHub ↗
(self, op: Cast)

Source from the content-addressed store, hash-verified

197 return s
198
199 def visit_cast(self, op: Cast) -> str:
200 if op.is_unchecked:
201 prefix = "unchecked "
202 else:
203 prefix = ""
204 return self.format(
205 "%r = %s%scast(%s, %r)", op, prefix, self.borrow_prefix(op), op.type, op.src
206 )
207
208 def visit_box(self, op: Box) -> str:
209 return self.format("%r = box(%s, %r)", op, op.src.type, op.src)

Callers

nothing calls this directly

Calls 2

formatMethod · 0.95
borrow_prefixMethod · 0.95

Tested by

no test coverage detected