See my implementation, is generic and not only for strings. It could be added to more-itertools, I suppose:
https://mail.python.org/archives/list/python-ideas@python.org/message/E452LQGA3XKU5ADPTG54XP36ENXDZN2B/ _______________________________________________ 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/TOCNFSPMUZSCFZCUEXMAOYEDYS65UDQH/ Code of Conduct: http://python.org/psf/codeofconduct/