Damn dude...
I'm sick and tired of writing stuff like
m = f( <...> )
if m:
# do stuff with m
Trivial as it may be, I for one welcome this.I'm sick and tired of writing stuff like
m = f( <...> )
if m:
# do stuff with m
Trivial as it may be, I for one welcome this. if m := re.match(...):
...
elif m := re.match(...):
...
The world is not coming to an end, as some detractors of the PEP might think. The new syntax is a win in a number of cases. Otherwise, you don't need to use it. The concern for abuse is way overblown. I could live without it (voted -1 on the idea originally) but now that it is in, think it is fine. case f <...> of
Nothing -> -- Handles the problem values
Just m -> -- do stuff with m
This is, honestly, much better than an assignment expression. Side-effect expressions always bring problematic cases.