[Python-Dev] Re: Candidate Itertools
Grégoire Dooms
dooms at info.ucl.ac.be
Wed Jun 16 04:26:42 EDT 2004
Raymond Hettinger wrote:
<snip ...>
>
>OTOH, if you actually want to end-up with a dictionary, it is somewhat
>wasteful to build one, throw it away, and then rebuild it from the
>itemlist:
>
> >>> dict(count_elements(words))
>
>
>
IMO, the dictionary would be more useful as :
>>> dict(pairswap(count_elements(words)))
And yes, it would be wasteful to produce it in this way.
--
Grégoire Dooms
More information about the Python-Dev
mailing list