Method: pylint.pyreverse.utils.get_annotation_label
Calls: 231, Exceptions: 0, Paths: 3Back
Path 1: 86 calls (0.37)
Name (86)
'int' (66) 'str' (12) 'Optional[int]' (2) 'DoNothing2' (2) 'Component' (2) 'float' (1) 'Sound' (1)
1def get_annotation_label(ann: nodes.Name | nodes.NodeNG) -> str:
2 if isinstance(ann, nodes.Name) and ann.name is not None:
3 return ann.name # type: ignore[no-any-return]
4 if isinstance(ann, nodes.NodeNG):
5 return ann.as_string() # type: ignore[no-any-return]
6 return ""
Path 2: 85 calls (0.37)
Subscript (36) Const (31) Attribute (12) BinOp (6)
'None' (30) 'Optional[int]' (5) 'set[str]' (5) 'Optional[str]' (5) 'dict[tokenize._Position, str]' (2) 'dict[str, tuple[tuple[int | None, str], ...]]'...
1def get_annotation_label(ann: nodes.Name | nodes.NodeNG) -> str:
2 if isinstance(ann, nodes.Name) and ann.name is not None:
3 return ann.name # type: ignore[no-any-return]
4 if isinstance(ann, nodes.NodeNG):
5 return ann.as_string() # type: ignore[no-any-return]
6 return ""
Path 3: 60 calls (0.26)
None (60)
'' (60)
1def get_annotation_label(ann: nodes.Name | nodes.NodeNG) -> str:
2 if isinstance(ann, nodes.Name) and ann.name is not None:
3 return ann.name # type: ignore[no-any-return]
4 if isinstance(ann, nodes.NodeNG):
5 return ann.as_string() # type: ignore[no-any-return]
6 return ""