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

Function _write_instance_repr

Tools/gdb/libpython.py:425–444  ·  view source on GitHub ↗

Shared code for use by all classes: write a representation to file-like object "out

(out, visited, name, pyop_attrdict, address)

Source from the content-addressed store, hash-verified

423
424
425def _write_instance_repr(out, visited, name, pyop_attrdict, address):
426 '''Shared code for use by all classes:
427 write a representation to file-like object "out"'''
428 out.write('<')
429 out.write(name)
430
431 # Write dictionary of instance attributes:
432 if isinstance(pyop_attrdict, (PyKeysValuesPair, PyDictObjectPtr)):
433 out.write('(')
434 first = True
435 items = pyop_attrdict.iteritems()
436 for pyop_arg, pyop_val in items:
437 if not first:
438 out.write(', ')
439 first = False
440 out.write(pyop_arg.proxyval(visited))
441 out.write('=')
442 pyop_val.write_repr(out, visited)
443 out.write(')')
444 out.write(' at remote 0x%x>' % address)
445
446
447class InstanceProxy(object):

Callers 1

write_reprMethod · 0.85

Calls 4

writeMethod · 0.45
iteritemsMethod · 0.45
proxyvalMethod · 0.45
write_reprMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…