Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/python/cpython
/ count_ops
Function
count_ops
Lib/test/test_capi/test_opt.py:82–83 ·
view source on GitHub ↗
(ex, name)
Source
from the content-addressed store, hash-verified
80
return
list(iter_ops(ex))
81
82
def
count_ops(ex, name):
83
return
len([opname
for
opname in iter_opnames(ex)
if
opname == name])
84
85
86
@requires_specialization
Callers
15
test_compare_int_eq_narrows_to_constant
Method · 0.85
test_compare_int_ne_narrows_to_constant
Method · 0.85
test_compare_float_eq_narrows_to_constant
Method · 0.85
test_compare_float_ne_narrows_to_constant
Method · 0.85
test_remove_guard_for_known_type_slice
Method · 0.85
test_binary_op_subscr_str_int
Method · 0.85
test_binary_op_subscr_ustr_int
Method · 0.85
test_binary_op_subscr_dict
Method · 0.85
test_contains_op
Method · 0.85
test_contains_op_set
Method · 0.85
test_contains_op_dict
Method · 0.85
test_call_len_string
Method · 0.85
Calls
1
iter_opnames
Function · 0.85
Tested by
no test coverage detected
Used in the wild
real call sites across dependent graphs
searching dependent graphs…