(obj, short=False)
| 43 | for s in args) |
| 44 | |
| 45 | def safe_repr(obj, short=False): |
| 46 | try: |
| 47 | result = repr(obj) |
| 48 | except Exception: |
| 49 | result = object.__repr__(obj) |
| 50 | if not short or len(result) < _MAX_LENGTH: |
| 51 | return result |
| 52 | return result[:_MAX_LENGTH] + ' [truncated]...' |
| 53 | |
| 54 | def strclass(cls): |
| 55 | return "%s.%s" % (cls.__module__, cls.__qualname__) |