On Dec 5, 3:44 pm, "Mark Tolonen" <[EMAIL PROTECTED]> wrote: > "eric" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > def flag(IGNORECASE=False, LOCALE=False, MULTILINE=False, > > DOTALL=False, UNICODE=False, VERBOSE=False): > > vals = [IGNORECASE, LOCALE, MULTILINE, DOTALL, UNICODE, VERBOSE] > > filtered = map( lambda m:m[1],filter( lambda m: m[0], > > zip(vals,'iLmsux'))) > > return '?'+''.join( filtered ) > > filtered = [c for c,v in zip('iLmsux',vals) if v] > > -Mark
thank you very much ! great ! I can't get used to this late 'if' syntax ! @Gerard nice hypercube function. But I'll keep with my implementation : I like to believe that the less the 'debug pointer' stands in the python code, the fastest the code is (or is potentially) I keep thinking that def hypercube(ndims) : for i in range(1<<ndims): yield [i&mask==mask for mask in [1<<j for j in range(ndims)] ] but thanks for you proposition, it's interesting anyway -- http://mail.python.org/mailman/listinfo/python-list