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
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
> 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):
>
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
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
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