(self, object, stream, indent, allowance, context, level)
| 511 | _dispatch[_types.MappingProxyType.__repr__] = _pprint_mappingproxy |
| 512 | |
| 513 | def _pprint_simplenamespace(self, object, stream, indent, allowance, context, level): |
| 514 | if type(object) is _types.SimpleNamespace: |
| 515 | # The SimpleNamespace repr is "namespace" instead of the class |
| 516 | # name, so we do the same here. For subclasses; use the class name. |
| 517 | cls_name = 'namespace' |
| 518 | else: |
| 519 | cls_name = object.__class__.__name__ |
| 520 | if self._expand: |
| 521 | indent += self._indent_per_level |
| 522 | else: |
| 523 | indent += len(cls_name) + 1 |
| 524 | items = object.__dict__.items() |
| 525 | stream.write(self._format_block_start(cls_name + '(', indent)) |
| 526 | self._format_namespace_items(items, stream, indent, allowance, context, |
| 527 | level) |
| 528 | stream.write(self._format_block_end(')', indent - self._indent_per_level)) |
| 529 | |
| 530 | _dispatch[_types.SimpleNamespace.__repr__] = _pprint_simplenamespace |
| 531 |
nothing calls this directly
no test coverage detected