Find names of variables which are written in the code Generate sequence of strings
(co)
| 1024 | yield (names[oparg >> 2], level, fromlist) |
| 1025 | |
| 1026 | def _find_store_names(co): |
| 1027 | """Find names of variables which are written in the code |
| 1028 | |
| 1029 | Generate sequence of strings |
| 1030 | """ |
| 1031 | STORE_OPS = { |
| 1032 | opmap['STORE_NAME'], |
| 1033 | opmap['STORE_GLOBAL'] |
| 1034 | } |
| 1035 | |
| 1036 | names = co.co_names |
| 1037 | for _, _, op, arg in _unpack_opargs(co.co_code): |
| 1038 | if op in STORE_OPS: |
| 1039 | yield names[arg] |
| 1040 | |
| 1041 | |
| 1042 | class Bytecode: |
nothing calls this directly
no test coverage detected
searching dependent graphs…