Auto generate string representation of the object. Args: cls: Class for which to generate the __str__ method.
(cls)
| 20 | |
| 21 | |
| 22 | def 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 | |
| 39 | class ObjectFactory: |
nothing calls this directly
no outgoing calls
no test coverage detected