[Python-ideas] Null coalescing operators
tjreedy at udel.edu
Mon Sep 21 22:23:03 CEST 2015
On 9/21/2015 10:56 AM, Paul Moore wrote:
> By the way, in your example you're passing on the "none or useful"
> property by making substr be either the matched value or None.
I agree that dealing with None immediately is better.
> life, I'd probably do something more like
> mo = re.match(needle, haystack)
> if mo:
except AttributeError: # no match
is equivalent unless process can also raise AttributeError.
Terry Jan Reedy
More information about the Python-ideas