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

Function is_part_of_annotation

src/black/nodes.py:1062–1065  ·  view source on GitHub ↗

Returns whether this leaf is part of a type annotation.

(leaf: Leaf)

Source from the content-addressed store, hash-verified

1060
1061
1062def is_part_of_annotation(leaf: Leaf) -> bool:
1063 """Returns whether this leaf is part of a type annotation."""
1064 assert leaf.parent is not None
1065 return get_annotation_type(leaf) is not None
1066
1067
1068def first_leaf(node: LN) -> Leaf | None:

Callers 2

_ensure_trailing_commaFunction · 0.90
do_matchMethod · 0.90

Calls 1

get_annotation_typeFunction · 0.85

Tested by

no test coverage detected