MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / makeReprStr

Function makeReprStr

utils/repr.py:1–10  ·  view source on GitHub ↗
(instance, spec=None)

Source from the content-addressed store, hash-verified

1def makeReprStr(instance, spec=None):
2 arg_list = []
3 for field in spec or ():
4 if isinstance(field, str):
5 repr_name, attr_name = field, field
6 else:
7 repr_name, attr_name = field
8 attr_val = getattr(instance, attr_name, 'N/A')
9 arg_list.append('{}={}'.format(repr_name, attr_val))
10 return '<{}({})>'.format(type(instance).__name__, ', '.join(arg_list))

Callers 9

__repr__Method · 0.90
__repr__Method · 0.90
__repr__Method · 0.90
__repr__Method · 0.90
__repr__Method · 0.90
__repr__Method · 0.90
__repr__Method · 0.90
__repr__Method · 0.90
__repr__Method · 0.90

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected