MCPcopy Index your code
hub / github.com/python/cpython / write_repr

Method write_repr

Tools/gdb/libpython.py:1442–1458  ·  view source on GitHub ↗
(self, out, visited)

Source from the content-addressed store, hash-verified

1440 return result
1441
1442 def write_repr(self, out, visited):
1443 # Guard against infinite loops:
1444 if self.as_address() in visited:
1445 out.write('(...)')
1446 return
1447 visited.add(self.as_address())
1448
1449 out.write('(')
1450 for i in safe_range(int_from_int(self.field('ob_size'))):
1451 if i > 0:
1452 out.write(', ')
1453 element = PyObjectPtr.from_pyobject_ptr(self[i])
1454 element.write_repr(out, visited)
1455 if self.field('ob_size') == 1:
1456 out.write(',)')
1457 else:
1458 out.write(')')
1459
1460class PyTypeObjectPtr(PyObjectPtr):
1461 _typename = 'PyTypeObject'

Callers

nothing calls this directly

Calls 8

safe_rangeFunction · 0.85
int_from_intFunction · 0.85
fieldMethod · 0.80
from_pyobject_ptrMethod · 0.80
as_addressMethod · 0.45
writeMethod · 0.45
addMethod · 0.45
write_reprMethod · 0.45

Tested by

no test coverage detected