"Paolo Pantaleo" <pa***********@gmail.com> wrote in message
news:ma***************************************@pyt hon.org...
So I tried this
if(not (attr=global_re.match(line)) ):
break
it says invalid syntax [on the =]
... because this syntax is not valid ...
so it is not possible to do test and assignment in C style?
... no it's not, see
http://www.python.org/doc/faq/genera...-an-expression
how can I write this otherwise?
... is this so bad?...
attr=global_re.match(line)
if not attr:
break
... or, since you don't seem to be doing much with attr, you could just do
if not global_re.match(line):
break
... and get rid of all those distracting ()'s!