Re: A more pythonic way of writting

2008-12-05 Thread eric
On Dec 6, 12:19 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Fri, 05 Dec 2008 07:44:21 -0800, eric wrote: > > I like to believe that the less the 'debug pointer' stands in the python > > code, the fastest the code is (or is potentially) > > What's a debug pointer? > > Pre-

Re: A more pythonic way of writting

2008-12-05 Thread Steven D'Aprano
On Fri, 05 Dec 2008 07:44:21 -0800, eric wrote: > I like to believe that the less the 'debug pointer' stands in the python > code, the fastest the code is (or is potentially) What's a debug pointer? Pre-mature optimization is the root of evil in programming. Unless you have actually *measured*

Re: A more pythonic way of writting

2008-12-05 Thread eric
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

Re: A more pythonic way of writting

2008-12-05 Thread Gerard flanagan
eric wrote: Hi, I've got this two pieces of code that works together, and fine def testit(): for vals in [[i&mask==mask for mask in [1<', flag(*vals) def flag(IGNORECASE=False, LOCALE=False, MULTILINE=False, DOTALL=False, UNICODE=False, VERBOSE=False): vals = [IGNORECASE, LOCALE, MULT

Re: A more pythonic way of writting

2008-12-05 Thread Mark Tolonen
"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]