Message394079
How is proposed_function("abcd", max_repeat=3) any different from what you can currently spell as combinations("aaabbbcccddd") ? Or, more generally,
def proposed_function(it, repeats)
repeated = chain.from_iterable([x] * repeat for x in it)
return combinations(repeated)
This can easily generalize to specifying the max count of each item. |
|
Date |
User |
Action |
Args |
2021-05-20 23:37:49 | Dennis Sweeney | set | recipients:
+ Dennis Sweeney, latot |
2021-05-20 23:37:49 | Dennis Sweeney | set | messageid: <1621553869.37.0.566929667162.issue44197@roundup.psfhosted.org> |
2021-05-20 23:37:49 | Dennis Sweeney | link | issue44197 messages |
2021-05-20 23:37:49 | Dennis Sweeney | create | |
|