Make sure parentheses are visible. They could be invisible as part of some statements (see :func:`normalize_invisible_parens` and :func:`visit_import_from`).
(leaf: Leaf)
| 1020 | |
| 1021 | |
| 1022 | def ensure_visible(leaf: Leaf) -> None: |
| 1023 | """Make sure parentheses are visible. |
| 1024 | |
| 1025 | They could be invisible as part of some statements (see |
| 1026 | :func:`normalize_invisible_parens` and :func:`visit_import_from`). |
| 1027 | """ |
| 1028 | if leaf.type == token.LPAR: |
| 1029 | leaf.value = "(" |
| 1030 | elif leaf.type == token.RPAR: |
| 1031 | leaf.value = ")" |
| 1032 | |
| 1033 | |
| 1034 | def is_name_token(nl: NL) -> TypeGuard[Leaf]: |
no outgoing calls
no test coverage detected