I get:
return r.group() if r := re.match(rx,l) else None
^
SyntaxError: invalid syntax
whereas
return r.group() if (r := re.match(rx,l)) else None
is accepted.
What is invalid about the first’s syntax? And what other interpretation of it is there, than the second, such that it is not unambiguous?