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

Method int_add

mypyc/irbuild/ll_builder.py:2512–2519  ·  view source on GitHub ↗

Helper to add two native integers. The result has the type of lhs.

(self, lhs: Value, rhs: Value | int)

Source from the content-addressed store, hash-verified

2510 return self.add(FloatComparisonOp(lhs, rhs, op, line))
2511
2512 def int_add(self, lhs: Value, rhs: Value | int) -> Value:
2513 """Helper to add two native integers.
2514
2515 The result has the type of lhs.
2516 """
2517 if isinstance(rhs, int):
2518 rhs = Integer(rhs, lhs.type)
2519 return self.int_op(lhs.type, lhs, rhs, IntOp.ADD, lhs.line)
2520
2521 def int_sub(self, lhs: Value, rhs: Value | int) -> Value:
2522 """Helper to subtract a native integer from another one.

Callers 7

gen_stepMethod · 0.80
vec_create_initializedFunction · 0.80
vec_create_from_valuesFunction · 0.80
vec_item_ptrFunction · 0.80
vec_containsFunction · 0.80
finishMethod · 0.80

Calls 3

int_opMethod · 0.95
IntegerClass · 0.90
isinstanceFunction · 0.85

Tested by

no test coverage detected