Merge pull request #1526 from tonybaloney/patch-1

Annotate only_one comment with additional context
This commit is contained in:
Will McGugan
2023-01-09 08:47:33 -08:00
committed by GitHub

View File

@@ -246,7 +246,7 @@ class DOMQuery(Generic[QueryType]):
# should *not* be anything there, so we *should* get an
# IndexError. We *could* have just checked the length of the
# query, but the idea here is to do the check as cheaply as
# possible.
# possible. "There can be only one!" -- Kurgan et al.
_ = self.nodes[1]
raise TooManyMatches(
"Call to only_one resulted in more than one matched node"