<p><br>
On Jan 2, 2011 4:15 PM, "Octavian Rasnita" <<a href="mailto:orasnita@gmail.com">orasnita@gmail.com</a>> wrote:<br>
><br>
><br>
> Octavian<br>
><br>
> ----- Original Message -----<br>
> From: "Alex Willmer" <<a href="mailto:alex@moreati.org.uk">alex@moreati.org.uk</a>><br>
> Newsgroups: comp.lang.python<br>
> To: <<a href="mailto:comp.lang.python@googlegroups.com">comp.lang.python@googlegroups.com</a>><br>
> Cc: <<a href="mailto:python-list@python.org">python-list@python.org</a>><br>
> Sent: Sunday, January 02, 2011 8:07 PM<br>
> Subject: Re: list 2 dict?<br>
><br>
><br>
> > On Sunday, January 2, 2011 3:36:35 PM UTC, T wrote:<br>
> >> The grouper-way looks nice, but I tried it and it didn't work:<br>
> >><br>
> >> from itertools import *<br>
> >> ...<br>
> >> d = dict(grouper(2, l))<br>
> >><br>
> >> NameError: name 'grouper' is not defined<br>
> >><br>
> >> I use Python 2.7. Should it work with this version?<br>
> ><br>
> > No. As Ian said grouper() is a receipe in the itertools documentation.<br>
> ><br>
> > <a href="http://docs.python.org/library/itertools.html#recipes">http://docs.python.org/library/itertools.html#recipes</a><br>
><br>
> I know that, that is why I used:<br>
><br>
> from itertools import *<br>
><br>
><br>
> Isn't enough?<br>
><br>
> Octavian<br>
></p>
<p>It would be, if, the function was actually a part of the itertools module. It isn't. It's just a code example used in the documentation.<br>
</p>