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

latot report at bugs.python.org
Thu May 20 16:26:22 EDT 2021


New submission from latot <felipematas at yahoo.com>:

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 repetitions.

Here I asked in stackoverflow about this if there is a lib or option, in the end we wasn't able to found any about this and there was an answer with the solution.

I think this solution worth to be added to itertools, conceptually, the actual 2 functions of combinations are particular cases of this function.

https://stackoverflow.com/questions/67559105/combinatory-with-n-picked-elements-and-limited-repetitions-in-python/67559625

Well, there can be a extension of this too, where we can say, "how many times every particular element can be repeated".

Both of this things world be useful.

Thx.

----------
components: Library (Lib)
messages: 394061
nosy: latot
priority: normal
severity: normal
status: open
title: [request feature] Itertools extended combinations to limited number of repetition

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44197>
_______________________________________


More information about the Python-bugs-list mailing list