This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lovi
Recipients lovi
Date 2019-12-14.07:54:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1576310084.51.0.108674240792.issue39045@roundup.psfhosted.org>
In-reply-to
Content
I thought for a long time. I think it's necessary to add a segment method to str type or string module. This method is used to split a string into m parts and return all cases.

For example:

segment('1234', m=3) -> [('1', '2', '34'), ('1', '23', '4'), ('12', '3', '4')]
segment('12345', m=3) -> [('1', '2', '345'), ('1', '23', '45'), ('1', '234', '5'), ('12', '3', '45'), ('12', '34', '5'), ('123', '4', '5')]


I hope this proposal can be adopted.
History
Date User Action Args
2019-12-14 07:54:44lovisetrecipients: + lovi
2019-12-14 07:54:44lovisetmessageid: <1576310084.51.0.108674240792.issue39045@roundup.psfhosted.org>
2019-12-14 07:54:44lovilinkissue39045 messages
2019-12-14 07:54:43lovicreate