Class for representing code-objects. This is similar to the original code object, but additionally the diassembled code is stored in the attribute '_tokens'.
| 92 | |
| 93 | |
| 94 | class Code: |
| 95 | """ |
| 96 | Class for representing code-objects. |
| 97 | |
| 98 | This is similar to the original code object, but additionally |
| 99 | the diassembled code is stored in the attribute '_tokens'. |
| 100 | """ |
| 101 | |
| 102 | def __init__(self, co, scanner, classname=None, show_asm=None): |
| 103 | # Full initialization is given below, but for linters |
| 104 | # well set up some initial values. |
| 105 | self.co_code = None # Really either bytes for >= 3.0 and string in < 3.0 |
| 106 | |
| 107 | for i in dir(co): |
| 108 | if i.startswith("co_"): |
| 109 | setattr(self, i, getattr(co, i)) |
| 110 | self._tokens, self._customize = scanner.ingest(co, classname, show_asm=show_asm) |
| 111 | |
| 112 | |
| 113 | class Scanner(ABC): |
no outgoing calls
no test coverage detected