Measured 2026-10-03 (frankuser)
# gm.py
def g(a, b=None):
yield a
yield b
# main
import gm
print(list(gm.g(1))) # pxx at pin v452: no overload of g matches
x = gm.g(5); print(next(x)) # (assignment position, same failure)
and
from itertools import count as _count
c = _count(1); print(next(c)) # segfault once count became a real generator
The alias desugars to _count = count, a variable holding the step routine's
address, so the call passed the user's argument where the instance belongs.
Fix
- ParseFactor's qualified-call arm: a stackless generator proc reached through qUnit builds a generator value.
- A from-import alias that names a stackless generator records the proc (PyAliasNameGen); the bare-name generator arm consults PyImportAliasGenProc before it gives up on a program-bound name.
Test: test/test_nilpy_mimic_itertools.npy (both import spellings) and
test/test_nilpy_classvar_counter.npy (from itertools import count as _count).