Path 1: 2645 calls (0.9)

'format' (169) 'abc' (70) 'items' (69) 'value' (65) 'error' (61) 'path' (56) 'keys' (51) 'split' (47) 'append' (45) 'c_dict' (34)

False (2645)

1def is_attr_protected(attrname: str) -> bool:
2    """Return True if attribute name is protected (start with _ and some other
3    details), False otherwise.
4    """
5    return (
6        attrname[0] == "_"
7        and attrname != "_"
8        and not (attrname.startswith("__") and attrname.endswith("__"))
9    )
            

Path 2: 309 calls (0.1)

'__init__' (79) '__name__' (27) '__new__' (23) '_bar' (15) '__class__' (14) '_attr' (10) '_protected' (9) '_replace' (6) '_foo' (6) '__instance' (6)

False (212) True (97)

1def is_attr_protected(attrname: str) -> bool:
2    """Return True if attribute name is protected (start with _ and some other
3    details), False otherwise.
4    """
5    return (
6        attrname[0] == "_"
7        and attrname != "_"
8        and not (attrname.startswith("__") and attrname.endswith("__"))
9    )