3 ms·
Could just have been if re.match(...).matched: But yeah, agree that Optional is what I want here. if let Some(m) := re.match(...) m.group(1).
by geofft 7y ago
Could just have been
if re.match(...).matched:
But yeah, agree that Optional is what I want here.
if let Some(m) := re.match(...)
m.group(1)...
m = re.match(...)
m.group(1) # TypeError because I haven't unwrapped the Optional
In current Python, that last line sometimes throws a runtime error.