(f, opname)
| 30 | |
| 31 | |
| 32 | def count_instr_recursively(f, opname): |
| 33 | count = 0 |
| 34 | for instr in dis.get_instructions(f): |
| 35 | if instr.opname == opname: |
| 36 | count += 1 |
| 37 | if hasattr(f, '__code__'): |
| 38 | f = f.__code__ |
| 39 | for c in f.co_consts: |
| 40 | if hasattr(c, 'co_code'): |
| 41 | count += count_instr_recursively(c, opname) |
| 42 | return count |
| 43 | |
| 44 | |
| 45 | def get_binop_argval(arg): |
no test coverage detected
searching dependent graphs…