B
Bengt Richter
So why shouldn't they get to?
If 'where: ...' were an expression suite ISTM you could write
if m where: m = someregexp.match(s) # same-line format
blah(m)
elif m where:
m = someotherregexp(s) # indented suite format
blah(m) # dedent from where-suite starts elif-suite
Regards,
Bengt Richter
I have a different suggestion for this.
'as' is used for renaming in import statements. 'as' will be used for exception
naming in Python 3k.
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
If 'where: ...' were an expression suite ISTM you could write
if m where: m = someregexp.match(s) # same-line format
blah(m)
elif m where:
m = someotherregexp(s) # indented suite format
blah(m) # dedent from where-suite starts elif-suite
Regards,
Bengt Richter