Method: pylint.checkers.utils.is_class_attr
Calls: 24, Exceptions: 20, Paths: 2Back
Path 1: 20 calls (0.83)
'_bar' (5) 'missing' (3) '_value_' (2) '__args' (2) '_baz' (1) '_qux' (1) 'test' (1) 'teta' (1) '__reader' (1) '__writer' (1)
ClassDef (20)
False (20)
AttributeInferenceError (20)
1def is_class_attr(name: str, klass: nodes.ClassDef) -> bool:
2 try:
3 klass.getattr(name)
4 return True
5 except astroid.NotFoundError:
6 return False
Path 2: 4 calls (0.17)
'data_descriptor' (1) 'non_data_descriptor' (1) 'attr2' (1) '_recoverable' (1)
ClassDef (4)
True (4)
1def is_class_attr(name: str, klass: nodes.ClassDef) -> bool:
2 try:
3 klass.getattr(name)
4 return True
5 except astroid.NotFoundError:
6 return False