Skip to content

Commit 365c140

Browse files
committed
Add a prettier repr for blocks.OrderedCode.
PiperOrigin-RevId: 599931954
1 parent c6869a1 commit 365c140

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pytype/blocks/blocks.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ def __init__(self, code, bytecode, order):
161161
for insn in bytecode:
162162
insn.code = self
163163

164+
def __repr__(self):
165+
return f"OrderedCode({self.qualname}, version={self.python_version})"
166+
164167
@property
165168
def co_consts(self):
166169
# The blocks/pyc code mixes CodeType and OrderedCode objects when

0 commit comments

Comments
 (0)