Re: wildcard exclusion in cartesian products

2006-03-26 Thread John Zenger
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:

Re: wildcard exclusion in cartesian products

2006-03-26 Thread [EMAIL PROTECTED]
Michael, Yes! That is precisely what I had in mind! Thanks, Walter Kehowski -- http://mail.python.org/mailman/listinfo/python-list

Re: wildcard exclusion in cartesian products

2006-03-26 Thread Michael Spencer
[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...