From 3f4bb0af3fa5d664641a19910b5ecd684072818e Mon Sep 17 00:00:00 2001 From: Anthony Shaw Date: Mon, 9 Jan 2023 08:14:06 +1100 Subject: [PATCH 1/2] Annotate only_one comment with additional context See #1490 --- src/textual/css/query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/textual/css/query.py b/src/textual/css/query.py index c14d032ab..fe9366d50 100644 --- a/src/textual/css/query.py +++ b/src/textual/css/query.py @@ -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!" -- Duncan McLeod _ = self.nodes[1] raise TooManyMatches( "Call to only_one resulted in more than one matched node" From 7a214578e92d43d896baab81c89751aa4d4f84aa Mon Sep 17 00:00:00 2001 From: Anthony Shaw Date: Mon, 9 Jan 2023 08:24:24 +1100 Subject: [PATCH 2/2] Update query.py --- src/textual/css/query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/textual/css/query.py b/src/textual/css/query.py index fe9366d50..9814382f9 100644 --- a/src/textual/css/query.py +++ b/src/textual/css/query.py @@ -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. "There can be only one!" -- Duncan McLeod + # 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"