From ad599675d11e2c81aa210e98d1c671eef0c09f23 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 7 Oct 2026 02:23:13 +0200 Subject: [PATCH] Answer prose round 2: top_streets says what it returns, and CheckIdentifier's doc opens with what it does --- data-import/geo.py | 4 ++-- internal/grammar/identifier.go | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/data-import/geo.py b/data-import/geo.py index 14c153d..9d31bc8 100644 --- a/data-import/geo.py +++ b/data-import/geo.py @@ -64,8 +64,8 @@ class Nearest: def top_streets(count, per_locality, column): - """count maps (locality, street name) to a count. Per locality, the per_locality names counted most, ties broken by - name, each row holding its count under column.""" + """count maps (locality, street name) to a count. Returns, per locality, rows for the per_locality names counted + most, ties broken by name; each row holds its count under column.""" of = collections.defaultdict(list) for (locality, name), n in count.items(): of[locality].append((n, name)) diff --git a/internal/grammar/identifier.go b/internal/grammar/identifier.go index dc2c5ae..07f05b7 100644 --- a/internal/grammar/identifier.go +++ b/internal/grammar/identifier.go @@ -13,8 +13,9 @@ const reservedInIdentifier = ".|({}/[]\"" var reservedList = strings.Join(strings.Split(reservedInIdentifier, ""), " ") -// An identifier names a folder, category, field, column or bound name. CheckIdentifier rejects one -// that the dot path, {token} and JSON grammars cannot spell, or that a struct tag cannot read. +// CheckIdentifier rejects an identifier that the dot path, {token} and JSON grammars cannot spell, +// or that a struct tag cannot read. An identifier names a folder, category, field, column or bound +// name. func CheckIdentifier(name string) error { if name == "" { return fmt.Errorf("%q is empty, which is not a path segment, so List never offers it", name)