A quick fix: change your last two functions to:
def generateNotMatching(A,n,P):
for g in gen(A,n,P,[]):
for x in g:
yield x
def gen(A,n,P,acc):
if any(imap((lambda p: allStar(p) and notNullOrZero(p,n)), P)):
yield []
else:
if n==0:
Michael,
Yes! That is precisely what I had in mind!
Thanks,
Walter Kehowski
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> The python code below is adapted from a Haskell program written by
> Tomasz
> Wielonka on the comp.lang.functional group. It's more verbose than his
> since I wanted to make sure I got it right.
>
> http://groups.google.com/group/comp.lang.functional/browse_frm/thread...