r"""Format an explanation. Normally all embedded newlines are escaped, however there are three exceptions: \n{, \n} and \n~. The first two are intended cover nested explanations, see function and attribute explanations for examples (.visit_Call(), visit_Attribute()). The last one
(explanation: str)
| 33 | |
| 34 | |
| 35 | def format_explanation(explanation: str) -> str: |
| 36 | r"""Format an explanation. |
| 37 | |
| 38 | Normally all embedded newlines are escaped, however there are |
| 39 | three exceptions: \n{, \n} and \n~. The first two are intended |
| 40 | cover nested explanations, see function and attribute explanations |
| 41 | for examples (.visit_Call(), visit_Attribute()). The last one is |
| 42 | for when one explanation needs to span multiple lines, e.g. when |
| 43 | displaying diffs. |
| 44 | """ |
| 45 | lines = _split_explanation(explanation) |
| 46 | result = _format_lines(lines) |
| 47 | return "\n".join(result) |
| 48 | |
| 49 | |
| 50 | def _split_explanation(explanation: str) -> List[str]: |
nothing calls this directly
no test coverage detected