Skip to content

Commit 6a7532d

Browse files
committed
Fix stale comment on leading-prefix skip condition
Code review noted the comment said "more than 1 rootnames" but the actual condition is total_length >= 1, which is true for essentially all real input. Clarify wording to match the condition.
1 parent 0908325 commit 6a7532d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

nameparser/parser.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,8 +1307,9 @@ def shift_conj_index(past: int, by: int) -> None:
13071307
i = 0
13081308
while i < len(pieces):
13091309
if not self.is_prefix(pieces[i]) or (i == 0 and total_length >= 1):
1310-
# If it's the first piece and there are more than 1 rootnames,
1311-
# assume it's a first name rather than a prefix.
1310+
# If it's the first piece and there's at least 1 rootname
1311+
# elsewhere, assume this piece is a first name rather than a
1312+
# prefix (total_length >= 1 covers essentially all real input).
13121313
i += 1
13131314
continue
13141315

0 commit comments

Comments
 (0)