
4 Dec
2019
4 Dec
'19
8:31 a.m.
04.12.19 03:46, Oscar Benjamin пише:
result = next(re.finditer(...), None) if result is None: # raise or something else: # use result
`next(re.finditer(...), None)` is a weird way of writing `re.search(...)`.
`next(re.finditer(...), defaults)` is the same as `re.search(...) or defaults`.