my current solution:
%python_module_iter(a:) %{-a*}-%{args} %{expand:%%{?!python_module_iter_%1:%%{python_module_iter -a %*}}}
%python_module_iter_STOP stop
%python_module() %{expand:%%define args %{**}} %{expand:%%{python_module_iter -a %{pythons} STOP}}
At four pythons, this is 14 levels deep. 3 levels per python, 2 for setup.
now the question is: can I fit one more?
holy fuck what a hack.
now to see if that other spec parser cares.
(it's this one: https://github.com/openSUSE/obs-build/blob/master/Build/Rpm.pm#L194 )
bad news: it cares.
well it doesn't, but will replace my very pretty expansion with "MACRO", which is, uh, not what I want.
I *could* get to 2 levels per python, if i didn't mind that the recursion never stops....
...which doesn't actually matter in RPM. It's some sort of error somewhere in the log, but the output is the right thing.