[issue44197] [request feature] Itertools extended combinations to limited number of repetition

2021-05-21 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> rhettinger stage: resolved -> type: -> enhancement versions: +Python 3.11 ___ Python tracker ___

[issue44197] [request feature] Itertools extended combinations to limited number of repetition

2021-05-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: > it seems too obscure and special-purpose to me to even > qualify as a reasonable candidate for an itertools doc "recipe" My thoughts are the same. @latot Thank you for the suggestion but it doesn't make sense for the standard library. We respectfully

[issue44197] [request feature] Itertools extended combinations to limited number of repetition

2021-05-20 Thread Tim Peters
Change by Tim Peters : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44197] [request feature] Itertools extended combinations to limited number of repetition

2021-05-20 Thread Tim Peters
Tim Peters added the comment: Dennis, combinations("aaabbbcccddd") isn't a valid call - the function requires a "how many?" argument too. If, e.g., we were asking for groups of 4, then combinations("aaabbbcccddd", 4) generates the 4-tuple ('a', 'b', 'c', 'd') 81 (3**4) times, while the OP

[issue44197] [request feature] Itertools extended combinations to limited number of repetition

2021-05-20 Thread Dennis Sweeney
Dennis Sweeney added the comment: 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

[issue44197] [request feature] Itertools extended combinations to limited number of repetition

2021-05-20 Thread latot
New submission from latot : Hi, some time ago I was looking for a function in itertools, actually, the combination functions allow us to have or not repetitions of element, have in consideration that if we allow repetitions there can be any amount of them, no way to limit the number of