6 Dec
2019
6 Dec
'19
9:21 p.m.
On Fri, Dec 6, 2019, at 15:17, Serhiy Storchaka wrote:
06.12.19 19:49, Random832 пише:
If match objects are too hard to use, maybe they should be made more user-friendly? What about adding str and iterable semantics to match objects so it can be used as str(re.search(...)); tuple(re.search(...)); a, b = re.search(...)?
What is semantic of these operations?
Sorry, I should have been more explicit, my intent was: def __iter__(self): yield from iter(self.groups()) def __str__(self): return self.group(0)