python3: accessing the result of 'if'

Paul Rubin http
Sat Jan 8 04:55:03 EST 2005


Nick Coghlan <ncoghlan at iinet.net.au> writes:
> So let's use it for expression naming in 'if' statements, too.
> 
> if someregexp.match(s) as m:
>    # blah using m
> elif someotherregexp.match(s) as m:
>    # blah using m

Certainly an improvement over what we have now.



More information about the Python-list mailing list