[Python-Dev] "as" mania

Josiah Carlson jcarlson at uci.edu
Tue Mar 7 19:25:54 CET 2006


Georg Brandl <g.brandl at gmx.net> wrote:
> or something like
> 
> m = re.match(...)
> if m.group(1) as filename:
>     do something with filename

Except that m could be None, which would raise an exception during the
.group(1) call.  Perhaps you meant...

m = re.match(...)
if m and m.group(1) as filename:
    do something with filename


I'm -1 on the 'as'-itis.
 - Josiah



More information about the Python-Dev mailing list