MCPcopy
hub / github.com/rocky/python-uncompyle6 / Code

Class Code

uncompyle6/scanner.py:94–110  ·  view source on GitHub ↗

Class for representing code-objects. This is similar to the original code object, but additionally the diassembled code is stored in the attribute '_tokens'.

Source from the content-addressed store, hash-verified

92
93
94class 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
113class Scanner(ABC):

Callers 13

build_classMethod · 0.90
comprehension_walkMethod · 0.90
comprehension_walk3Method · 0.90
closure_walkMethod · 0.90
make_function2Function · 0.90
make_function3_annotateFunction · 0.90
make_function3Function · 0.90
make_function36Function · 0.90
comprehension_walkMethod · 0.90
listcomp_closure3Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected