Shared code for use by all classes: write a representation to file-like object "out
(out, visited, name, pyop_attrdict, address)
| 423 | |
| 424 | |
| 425 | def _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 | |
| 447 | class InstanceProxy(object): |
no test coverage detected
searching dependent graphs…