Format value for printing to console.
(value: str, width: int = 80, nl_width: int = 80, sep: str = '\n', **
kw: Any)
| 101 | |
| 102 | |
| 103 | def pretty(value: str, width: int = 80, nl_width: int = 80, sep: str = '\n', ** |
| 104 | kw: Any) -> str: |
| 105 | """Format value for printing to console.""" |
| 106 | if isinstance(value, dict): |
| 107 | return f'{sep} {pformat(value, 4, nl_width)[1:]}' |
| 108 | elif isinstance(value, tuple): |
| 109 | return '{}{}{}'.format( |
| 110 | sep, ' ' * 4, pformat(value, width=nl_width, **kw), |
| 111 | ) |
| 112 | else: |
| 113 | return pformat(value, width=width, **kw) |
| 114 | |
| 115 | |
| 116 | def match_case(s: str, other: str) -> str: |