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

Method visit_atom

src/black/linegen.py:560–576  ·  view source on GitHub ↗

Visit any atom

(self, node: Node)

Source from the content-addressed store, hash-verified

558 yield from self.visit_default(leaf)
559
560 def visit_atom(self, node: Node) -> Iterator[Line]:
561 """Visit any atom"""
562 if len(node.children) == 3:
563 first = node.children[0]
564 last = node.children[-1]
565 if (first.type == token.LSQB and last.type == token.RSQB) or (
566 first.type == token.LBRACE and last.type == token.RBRACE
567 ):
568 # Lists or sets of one item
569 maybe_make_parens_invisible_in_atom(
570 node.children[1],
571 parent=node,
572 mode=self.mode,
573 features=self.features,
574 )
575
576 yield from self.visit_default(node)
577
578 def visit_fstring(self, node: Node) -> Iterator[Line]:
579 # If the fstring was converted to a STANDALONE_COMMENT by

Callers

nothing calls this directly

Calls 2

visit_defaultMethod · 0.95

Tested by

no test coverage detected