Re: inline comparison

2005-03-21 Thread Steve Holden
sam wrote: Diez B. Roggisch wrote: If you really need that sort of dependent matching, there are better ways to accomplish that in python: for m, name in [self.macro_parser, self.a_parser, self.b_parser, ...]: mo = m.match(data) if mo: break Hi, this method looks more elegant. How

Re: inline comparison

2005-03-21 Thread sam
Diez B. Roggisch wrote: If you really need that sort of dependent matching, there are better ways to accomplish that in python: for m, name in [self.macro_parser, self.a_parser, self.b_parser, ...]: mo = m.match(data) if mo: break Hi, this method looks more elegant. However I got th

Re: inline comparison

2005-03-20 Thread Diez B. Roggisch
> This is very bad to me, I will need to write some cumbersome syntax as > follow: > for d in self.data: > m = self.macro_parser.match (d)) != None ): > if (m == None): > m_nat = self.a_parser.match (d) > if (m_a == None): >

Re: inline comparison

2005-03-20 Thread sam
Tim Roberts wrote: sam <[EMAIL PROTECTED]> wrote: Hi, I got the the following syntax error in comparison: File "/usr/local/work/myparser.py", line 85 if ( (m=self.macro_parser.match (d)) != None ): ^ SyntaxError: invalid syntax How can I get around wtih this? I don't want to break do

Re: inline comparison

2005-03-19 Thread Tim Roberts
sam <[EMAIL PROTECTED]> wrote: >Hi, > >I got the the following syntax error in comparison: > File "/usr/local/work/myparser.py", line 85 > if ( (m=self.macro_parser.match (d)) != None ): >^ >SyntaxError: invalid syntax > >How can I get around wtih this? I don't want to break down

Re: inline comparison

2005-03-19 Thread Peter Hansen
sam wrote: I got the the following syntax error in comparison: File "/usr/local/work/myparser.py", line 85 if ( (m=self.macro_parser.match (d)) != None ): ^ SyntaxError: invalid syntax How can I get around wtih this? Break the comparison into two steps. > I don't want to break dow