Method: pylint.checkers.utils.is_attr_private
Calls: 3286, Exceptions: 0, Paths: 1Back
Path 1: 3286 calls (1.0)
'__init__' (324) 'test' (74) '__slots__' (63) 'x' (59) 'method' (52) 'a' (47) 'func' (43) 'my_var' (42) '__iter__' (32) '__len__' (31)
None (3187) Match (99)
1def is_attr_private(attrname: str) -> Match[str] | None:
2 """Check that attribute name is private (at least two leading underscores,
3 at most one trailing underscore).
4 """
5 regex = re.compile("^_{2,10}.*[^_]+_?$")
6 return regex.match(attrname)