"more-itertools" seems to be a modestly popular library (top 100-500?) that
includes the stdlib itertools recipes and more.
https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.powerset
On Tue, Oct 16, 2018 at 3:42 AM Hasan Diwan wrote:
> Pal,
> On Tue, 16 Oct 2018 at 01:36,
On Tuesday, October 16, 2018, Greg Ewing
wrote:
> Wes Turner wrote:
>
>> Is there a name for an iteration of the powerset which is more useful for
>> binary search? I.e. instead of starting with null set, start with the
>> "middle" ( r/2 ).
>>
>
> You'll have to provide more detail about what
Can we get an utilisation context ?
I don't think it belongs in the stdlib alone on the basis that its output
is not linear in the size of its input (but exponential), so it explode
even for a mid-sized list, which by nature limits greatly its usage.
The question would be wether or not it is used
Pal,
On Tue, 16 Oct 2018 at 01:36, Pål Grønås Drange wrote:
> I do however agree that there could be a powerset function there for
> convenience, but only +0.
That is the best argument I could come up with to justify a
set#powerset method. -- H
--
OpenPGP:
> [...] when one searches for a powerset function, the
> logical place to look isn't itertools, it's the set class. -- H
That's a rather object-oriented view, I think.
So you look for the permutation function in the list class?
I prefer these functions gathered in one place, and I find that
On Mon, 15 Oct 2018 at 23:25, Pål Grønås Drange wrote:
> Hasan, if you recall that the powerset is just
> `yield from S choose k for k from 0 to |S|+1`,
> you see that that is exactly the implementation in the examples page.
I know that, but when one searches for a powerset function, the
logical
> Is there a name for an iteration of the powerset which is more useful for
binary search? I.e. instead of starting with null set, start with the
"middle" ( r/2 ).
>
> Maybe a bit OT, but is there a name for such a combinatorial search?
Not that I know of, especially since this has the
Wes Turner wrote:
Is there a name for an iteration of the powerset which is more useful
for binary search? I.e. instead of starting with null set, start with
the "middle" ( r/2 ).
You'll have to provide more detail about what you want to search
and how you intend to search it. There isn't a
Is there a name for an iteration of the powerset which is more useful for
binary search? I.e. instead of starting with null set, start with the
"middle" ( r/2 ).
Maybe a bit OT, but is there a name for such a combinatorial search?
On Monday, October 15, 2018, Hasan Diwan wrote:
> > This is
> This is certainly the right place to discuss this, but you shouldn't
> assume that everyone reading will know what powerset functionality you
> are referring to.
> Is it the same as the recipe in the itertools documentation?
Yes pretty much.
>
>
Hi Hasan, and welcome,
On Mon, Oct 15, 2018 at 11:15:47AM -0700, Hasan Diwan wrote:
> [if this isn't the correct spot, let me know and I'll gladly take it
> elsewhere]
> I have found myself needing powerset functionality several times
> recently to the point where I wondered if there's interest
Hi Hassan,
I think this is unlikely to get added to the standard library as it is
listed as a recipe in the itertools module (
https://docs.python.org/3/library/itertools.html#itertools-recipes).
You may want to check out the more-itertools package (
[if this isn't the correct spot, let me know and I'll gladly take it elsewhere]
I have found myself needing powerset functionality several times
recently to the point where I wondered if there's interest in making
it part of the standard library. I have a working implementation and
tests. Would
13 matches
Mail list logo