Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
Index your code
hub
/
github.com/python/mypy
/ numeric_value
Method
numeric_value
mypyc/ir/ops.py:218–221 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
216
self.line = line
217
218
def
numeric_value(self) -> int:
219
if
is_short_int_rprimitive(self.type) or is_int_rprimitive(self.type):
220
return
self.value // 2
221
return
self.value
222
223
224
@final
Callers
6
truncate_literal
Function · 0.80
coerce
Method · 0.80
binary_op
Method · 0.80
unary_minus
Method · 0.80
_extract_python_literal
Function · 0.80
buf_init_item
Function · 0.80
Calls
2
is_short_int_rprimitive
Function · 0.90
is_int_rprimitive
Function · 0.90
Tested by
no test coverage detected