[Python-ideas] Haskell envy
Ned Batchelder
ned at nedbatchelder.com
Tue Apr 24 01:45:37 CEST 2012
On 4/23/2012 3:55 PM, Raymond Hettinger wrote:
>
> On Apr 23, 2012, at 9:52 AM, Steven D'Aprano wrote:
>
>> However, the discoverability of this solution is essentially zero
>
> That exact code has been in the documentation for years:
>
> def powerset(iterable):
> "powerset([1,2,3]) --> () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)"
> s = list(iterable)
> return chain.from_iterable(combinations(s, r) for r in range(len(s)+1))
>
> The whole purpose of the itertools recipes are to teach how
> the itertools can be readily combined to build new tools.
>
> http://docs.python.org/library/itertools.html#module-itertools
>
>
Raymond's "that code has been in the docs for years," and Steven's "the
discoverability of this solution is essentially zero" are not
contradictions. It sounds like we need a better way to find the
information in the itertools docs. For example, there is no index entry
for "powerset", and I don't know what term Steven tried looking it up
with. Sounds like you two could work together to make people more aware
of the tools we've already got.
--Ned.
> Raymond
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20120423/99f5f873/attachment.html>
More information about the Python-ideas
mailing list