"Paolo Pantaleo" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
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/general/#why-can-t-i-use-an-assignment-in-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!
--
http://mail.python.org/mailman/listinfo/python-list