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

Method visit_BinOp

mypy/fastparse.py:2027–2039  ·  view source on GitHub ↗
(self, n: ast3.BinOp)

Source from the content-addressed store, hash-verified

2025 return UnboundType(n.id, line=self.line, column=self.convert_column(n.col_offset))
2026
2027 def visit_BinOp(self, n: ast3.BinOp) -> Type:
2028 if not isinstance(n.op, ast3.BitOr):
2029 return self.invalid_type(n)
2030
2031 left = self.visit(n.left)
2032 right = self.visit(n.right)
2033 return UnionType(
2034 [left, right],
2035 line=self.line,
2036 column=self.convert_column(n.col_offset),
2037 is_evaluated=self.is_evaluated,
2038 uses_pep604_syntax=True,
2039 )
2040
2041 def visit_Constant(self, n: ast3.Constant) -> Type:
2042 val = n.value

Callers

nothing calls this directly

Calls 5

invalid_typeMethod · 0.95
visitMethod · 0.95
convert_columnMethod · 0.95
UnionTypeClass · 0.90
isinstanceFunction · 0.85

Tested by

no test coverage detected