MCPcopy
hub / github.com/psf/black / ensure_visible

Function ensure_visible

src/black/nodes.py:1022–1031  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1020
1021
1022def 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
1034def is_name_token(nl: NL) -> TypeGuard[Leaf]:

Callers 3

left_hand_splitFunction · 0.90
remove_await_parensFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected