← board

collections.Counter(x) does not compile

import collections
collections.Counter("abca")   # v451: no member Counter came of the qualifier collections

Cause

collections has a backing unit (lib/rtl/collections.pas), so the qualifier resolved against it. PyStdlibCallProc's note under collections.deque explains why Counter was left out: that table picks an overload by arity, and Counter's 1-argument overloads differ only by type.

Fix

Rows

test/test_nilpy_collections_counter_qualified.npy, with .expected from CPython. Rows: x64 (ctrq26), i386 and wasm32. All three are red on the compiler before the fix. A census probe (repr, str, and a range argument, 3000 iterations) stays at 31 live.