Py2.3: Feedback on Sets (fwd)
aahz at pythoncraft.com
Sat Aug 16 19:44:06 CEST 2003
In article <mailman.1061051286.23348.python-list at python.org>,
David Mertz <mertz at gnosis.cx> wrote:
>The mention of Set.powerset() above is quite interesting to me. It
>feels both exciting and dangerous :-).
>As we all know, the size of the powerset of S, for len(S)==N, is 2**N.
>Seems like it would be really easy to run into some long runtimes and
>memory usage. Then again, power set really is a fundamental operation
>on sets. And making users rewrite it each time is error prone.
Maybe make it an iterator? <0.3 wink>
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
This is Python. We don't care much about theory, except where it intersects
with useful practice. --Aahz
More information about the Python-list