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) _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/BURCY5IOZXF2GLRS5J5KCUAOS65VHMRV/ Code of Conduct: http://python.org/psf/codeofconduct/