MCPcopy Create free account
hub / github.com/alpha2phi/python-apps / auto_str

Function auto_str

excel-ingester/loader/__init__.py:22–36  ·  view source on GitHub ↗

Auto generate string representation of the object. Args: cls: Class for which to generate the __str__ method.

(cls)

Source from the content-addressed store, hash-verified

20
21
22def auto_str(cls):
23 """Auto generate string representation of the object.
24
25 Args:
26 cls: Class for which to generate the __str__ method.
27 """
28
29 def __str__(self):
30 return "%s(%s)" % (
31 type(self).__name__,
32 ", ".join("%s=%s" % item for item in vars(self).items()),
33 )
34
35 cls.__str__ = __str__
36 return cls
37
38
39class ObjectFactory:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected