Path 1: 4 calls (0.36)

bytes (4)

False (4)

1def is_line_commented(line: bytes) -> bool:
2    """Checks if a `# symbol that is not part of a string was found in line."""
3
4    comment_idx = line.find(b"#")
5    if comment_idx == -1:
6        return False
7    if comment_part_of_string(line, comment_idx):
8        return is_line_commented(line[:comment_idx] + line[comment_idx + 1 :])
9    return True
            

Path 2: 4 calls (0.36)

bytes (4)

False (3) True (1)

1def is_line_commented(line: bytes) -> bool:
2    """Checks if a `# symbol that is not part of a string was found in line."""
3
4    comment_idx = line.find(b"#")
5    if comment_idx == -1:
6        return False
7    if comment_part_of_string(line, comment_idx):
8        return is_line_commented(line[:comment_idx] + line[comment_idx + 1 :])
9    return True
            

Path 3: 3 calls (0.27)

bytes (3)

True (3)

1def is_line_commented(line: bytes) -> bool:
2    """Checks if a `# symbol that is not part of a string was found in line."""
3
4    comment_idx = line.find(b"#")
5    if comment_idx == -1:
6        return False
7    if comment_part_of_string(line, comment_idx):
8        return is_line_commented(line[:comment_idx] + line[comment_idx + 1 :])
9    return True